Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bagder
Copy link
Member

@bagder bagder commented Aug 26, 2024

To properly handle https://example.com/?%611&a2&a3 --trim query=a*, trurl now "normalizes" the query pairs by an extra round of URL decode + encode.

If a query pair gets normalized, consider it modified which in turn triggers a URL update. Thus

trurl 'https://example.com/?%611&a2&a3'

outputs

https://example.com/?a1&a2&a3

The query part URL encodes spaces to pluses (and vice versa). Note that %20 in the query in the input URL will be normalized to a +.

Updated several tests accordingly.

Reported-by: Emanuele Torre
Fixes #326

To properly handle https://example.com/?%611&a2&a3 --trim query=a*,
trurl now "normalizes" the query pairs by an extra round of URL decode +
encode.

If a query pair gets normalized, consider it modified which in turn
triggers a URL update. Thus

  trurl 'https://example.com/?%611&a2&a3'

outputs

  https://example.com/?a1&a2&a3

The query part URL encodes spaces to pluses (and vice versa). Note that
%20 in the query in the input URL will be normalized to a +.

Updated several tests accordingly.

Reported-by: Emanuele Torre
Fixes #326
Closes #328
@bagder bagder force-pushed the bagder/normalize-queries branch from de39ac2 to 520f988 Compare August 27, 2024 05:54
@bagder bagder merged commit caaec33 into master Aug 27, 2024
@bagder bagder deleted the bagder/normalize-queries branch August 27, 2024 06:01
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.

--trim checks query keys literally ignoring URL encoding

1 participant