Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urlEncode should use url.PathEscape not url.QueryEscape #286

Open
idc77 opened this issue Feb 1, 2022 · 0 comments
Open

urlEncode should use url.PathEscape not url.QueryEscape #286

idc77 opened this issue Feb 1, 2022 · 0 comments

Comments

@idc77
Copy link

idc77 commented Feb 1, 2022

the urlescape filter is using url.QueryEscape and not url.PathEscape.
You might have PHP roots where urlencode is used, but url.QueryEscape is not the proper replacement as is encodes QUERIES not PATHS.
An URL has paths and queries.

There should be pathEscape and queryEscape and for compatibility reasons urlescape should be using url.PathEscape, in the long run urlescape should be deprecated.

Why? Because if you use QueryEscape to encode a PATH you will receive wrong results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants