Skip to content

fix(bing-serp): do not rewrite result URLs that use their own u parameter - #2540

Open
Yutong Song (RainieLLM) wants to merge 2 commits into
microsoft:mainfrom
RainieLLM:fix/bing-serp-keep-non-redirect-urls
Open

Yutong Song (RainieLLM) wants to merge 2 commits into
microsoft:mainfrom
RainieLLM:fix/bing-serp-keep-non-redirect-urls

Conversation

@RainieLLM

@RainieLLM Yutong Song (RainieLLM) commented Sep 19, 2026

Copy link
Copy Markdown

Summary

BingSerpConverter decoded the u query parameter on every result link. As a result, a normal URL such as https://example.com/profile?u=abcdef could become an invalid link.

This change limits decoding to Bing's exact /ck/a path on bing.com or its subdomains. Normal URLs and links with similar hosts or paths stay unchanged.

Validation

  • The regression tests report 5 passed.
  • The existing Bing SERP vector reports 6 local cases passed. The remote HTTP case could not run because raw.githubusercontent.com was unavailable.
  • The full non-CLI suite previously reported 831 passed. Its five external-service failures also occur on main.
  • Black reports no formatting changes.

…eter

Bing puts each search result behind a /ck/a redirect link. The real
destination sits in a base64 `u` query parameter, and the converter decodes
it. The decoder did not check the link, so it decoded the `u` parameter of
every <a href> in the result. A normal result that uses `u=` for its own
purpose was therefore rewritten into garbage.

Decode the `u` parameter only when the link is one that Bing wrapped.
@RainieLLM

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant