Skip to content

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

Merged
LossyDragon merged 2 commits into
Longi94:masterfrom
anxinxu:master
Apr 29, 2026
Merged

cdn: 规范化 query 参数处理#384
LossyDragon merged 2 commits into
Longi94:masterfrom
anxinxu:master

Conversation

@anxinxu

@anxinxu anxinxu commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

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

@anxinxu anxinxu left a comment

Copy link
Copy Markdown
Contributor Author

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?

@anxinxu

anxinxu commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

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

Yes, I've changed it like this now

@LossyDragon LossyDragon merged commit bac631b into Longi94:master Apr 29, 2026
1 check passed
@LossyDragon LossyDragon mentioned this pull request Apr 29, 2026
4 tasks
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