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

Encode URI templates according to spec #41

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tpluscode
Copy link
Contributor

I found that templates were incorrectly produced, cells being not fully encoded as per RFC3986.

For example, parentheses were not percent-encoded, likely being done by JS' flawed implementation of encodeURIComponent

This PR switches to a different implementation of the RFC6570 spec which does the encoding correctly.

@@ -1,4 +1,5 @@
const fs = require('fs')
const encodeURIComponent = require('strict-uri-encode')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not exactly related to the issue but I thought it useful to actually produce correct templates. While I did not observe any problems, according to the URI Templates spec, template variables should also be encoded

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