Skip to content

Encode URI templates according to spec#41

Open
tpluscode wants to merge 3 commits intordf-ext:masterfrom
tpluscode:encode-parens
Open

Encode URI templates according to spec#41
tpluscode wants to merge 3 commits intordf-ext:masterfrom
tpluscode:encode-parens

Conversation

@tpluscode
Copy link
Copy Markdown
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.

Comment thread lib/MetadataBuilder.js
@@ -1,4 +1,5 @@
const fs = require('fs')
const encodeURIComponent = require('strict-uri-encode')
Copy link
Copy Markdown
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