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

Not following the RFC on + and # template placeholders #7

Closed
castaway opened this Issue Jul 9, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@castaway
Contributor

castaway commented Jul 9, 2018

Hi,

I'm contributing (as part of Shadowcat Systems), to work on the Paws API (https://github.com/pplu/aws-sdk-perl). Paws uses URI::Template, in a way specified with the RFC - it passes in pre-uri-encoded values for placeholders that are marked with a leading +, which are expected not to be encoded again - as stated here https://tools.ietf.org/html/rfc6570#section-3.2.1

It appears from the code that URI::Template treats +XX, #XX and XX all the same, and thus the values end up double-encoded.

Any thoughts? I will start looking into a patch.

@bricas

This comment has been minimized.

Owner

bricas commented Jul 9, 2018

I've just updated the test suite submodule to the latest commit and everything still passes.

A failing test case would be very helpful.

@castaway

This comment has been minimized.

Contributor

castaway commented Jul 9, 2018

Yup, I also noticed it has none.. I've just found someone elses similar request on the Java uri template module.. but looks like nobody reported the issue back to the main test suite.. damnhandy/Handy-URI-Templates#51

I will create some tests.

@castaway

This comment has been minimized.

Contributor

castaway commented Jul 10, 2018

Here's my branch on uritemplates-test to add some, which I copied into t/cases to verify: https://github.com/castaway/uritemplate-test/tree/reserved-pct-encoded

castaway added a commit to shadow-dot-cat/uri-template that referenced this issue Jul 10, 2018

castaway added a commit to shadow-dot-cat/uri-template that referenced this issue Jul 10, 2018

bricas added a commit that referenced this issue Jul 10, 2018

Merge pull request #8 from shadow-dot-cat/reserved_pct_encoded
Ensure we don't re-encode pre-encoded values for +var and #var #7
@bricas

This comment has been minimized.

Owner

bricas commented Jul 10, 2018

Fixed in #8 and released in version 0.23. Cheers!

@bricas bricas closed this Jul 10, 2018

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