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

Percent encoding of ~ #394

Closed
ghost opened this issue Aug 25, 2021 · 3 comments · Fixed by #395
Closed

Percent encoding of ~ #394

ghost opened this issue Aug 25, 2021 · 3 comments · Fixed by #395

Comments

@ghost
Copy link

ghost commented Aug 25, 2021

Currently cmark percent encodes ~ but it doesn't do for . _ -

All 4 of them are unreserved. Shouldn't ~ also not be percent encoded?

@jgm
Copy link
Member

jgm commented Aug 25, 2021

I don't know, this comes from houdini_href_e.c which was originally from GitHub.
It seems that ~ was required to be encoded in the past, and maybe the code is just playing it safe:
https://jkorpela.fi/tilde.html

@ghost
Copy link
Author

ghost commented Aug 28, 2021

RFC 3986 section-2.3 says,

For consistency, percent-encoded octets in the ranges of ALPHA
(%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period (%2E),
underscore (%5F), or tilde (%7E) should not be created by URI
producers and, when found in a URI, should be decoded to their
corresponding unreserved characters by URI normalizers.

@jgm
Copy link
Member

jgm commented Aug 28, 2021

I'm happy to change this if you want to submit a PR.
Probably just need to change one item in the array in houdini_href_e.c from 1 to 0.

@jgm jgm closed this as completed in #395 Aug 29, 2021
jgm pushed a commit that referenced this issue Aug 29, 2021
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 a pull request may close this issue.

1 participant