Skip to content

Fix of parameters sorting#8

Open
ilnarb wants to merge 1 commit into
wandenberg:masterfrom
ilnarb:master
Open

Fix of parameters sorting#8
ilnarb wants to merge 1 commit into
wandenberg:masterfrom
ilnarb:master

Conversation

@ilnarb

@ilnarb ilnarb commented May 26, 2026

Copy link
Copy Markdown

The following issues have been fixed

  1. wrong result of comparison due 'rc = -1;' after equality complete on min len of two, for example, key=value&key=value1 will lead to key=value1&key=value
  2. RFC 3986 says params are case-sensitive, but ngx_http_sorted_querystring_cmp_parameters uses ngx_strncasecmp
  3. the first if compare only min len bytes of keys, so the names are not sorted lexicographically for certain cases, for example key=value, key1=value1, coz '1' < '='

The following issues have been fixed
1. wrong result of comparison due 'rc = -1;' after equality `complete` on min len of two, for example, key=value&key=value1 will lead to key=value1&key=value
2. RFC 3986 says params are case-sensitive, but ngx_http_sorted_querystring_cmp_parameters uses ngx_strncasecmp
3. the first if compare only min len, so the names are not sorted lexicographically for certain cases, for example key=value, key1=value1, coz '1' < '='
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