Skip to content

cdn: 规范化 query 参数处理#384

Open
anxinxu wants to merge 1 commit intoLongi94:masterfrom
anxinxu:master
Open

cdn: 规范化 query 参数处理#384
anxinxu wants to merge 1 commit intoLongi94:masterfrom
anxinxu:master

Conversation

@anxinxu
Copy link
Copy Markdown

@anxinxu anxinxu commented Apr 26, 2026

Description

his PR tightens query-string handling when building CDN request URLs in Client (steam/cdn).

Empty query: If the optional query argument is an empty string, it is treated as “no query” and no query parameters are appended (avoids pointless work and odd ?-only URLs).
Leading ?: If the string starts with ?, that prefix is stripped before splitting on &, so callers can pass either foo=bar or ?foo=bar and get the same parsed parameters.
No README or public API changes.

Checklist

  • Code compiles correctly
  • All tests passing
  • Samples run successfully
  • Extended the README / documentation, if necessary

Copy link
Copy Markdown
Author

@anxinxu anxinxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LossyDragon Could a maintainer please approve the workflows for this fork PR? Thanks.

@LossyDragon
Copy link
Copy Markdown
Collaborator

If I understand your PR correctly, wouldn't val params = queryString.trimStart('?').split("&") suffice as well?

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.

2 participants