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

Fix uri format to follow RFC 3986 #2157

Merged
merged 1 commit into from
Jul 13, 2023
Merged

Conversation

itchyny
Copy link
Contributor

@itchyny itchyny commented Jul 9, 2020

It seems that the current implementation is based on RFC 2396 - 2.3. Unreserved Characters. However, this RFC is obsoleted by RFC 3986. At RFC 3986 - 2.3. Unreserved Characters, the unreserved characters are defined as follows.

unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"

Thus we should update the implementation to follow the RFC 3986.

 % echo "-_.~\!'()" | jq -R @uri
"-_.~!'()"
 % echo "-_.~\!'()" | ./jq  -R @uri
"-_.~%21%27%28%29"

Resolves #1506.

@coveralls
Copy link

coveralls commented Jul 9, 2020

Coverage Status

Coverage increased (+0.4%) to 84.525% when pulling bafbe91 on itchyny:fix-uri-rfc3986 into a17dd32 on stedolan:master.

@itchyny itchyny changed the title Fix uri format to follow RFC3986 Fix uri format to follow RFC 3986 Jul 9, 2020
@itchyny itchyny added this to the 1.7 release milestone Jun 25, 2023
@itchyny
Copy link
Contributor Author

itchyny commented Jul 13, 2023

Thank you.

@itchyny itchyny merged commit 689a4e6 into jqlang:master Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@uri is not percent-encoding all reserved characters
3 participants