Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Interestingly, quite a few places that should treat query strings transparently make a lot of assumptions about their structure. We ran into that when picking a new CDN, some providers didn't handle repeat parameters (?a=1&a=2) correctly.


For anyone curious like I was, form-urlencoded and the URLSearchParam API says that params should not be deduplicated or reordered. "Get" will get the first value with the given name, and GetAll will get a list of all values

https://url.spec.whatwg.org/#dom-urlsearchparams-get


What’s do you mean by correctly?


Incorrectly would be processing the query string and deduping keys. Correctly would be passing it through as-is, or at least only lightly processing it, like normalizing escaping or such.


Indeed I would expect pass through with no changes.

Though there are “smart” CDNs that will resize images etc. all beats are off for those.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: