url-signature icon indicating copy to clipboard operation
url-signature copied to clipboard

Hash Generation and Validation for arrays in query string

Open dsentker opened this issue 3 years ago • 0 comments

This library handles query string parameters nearly perfect. The hash of the URL will always be the same, even if the parameters in the query string are swapped. This works because this library sorts the query string parameters before the hash process.

But that is not true for arrays in query string: Take the following URL, for example: //example.com/foo?a[]=1&a[]=2

During normalization, the "a" key from query string is used to get sorted. However, the fact that this parameter occurs more than once is completely ignored.

The Solution is to use a better query-string-sort technique.

dsentker avatar Mar 14 '21 00:03 dsentker