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

The path encoding fails on : #14

Closed
orasimus opened this issue Dec 30, 2015 · 5 comments
Closed

The path encoding fails on : #14

orasimus opened this issue Dec 30, 2015 · 5 comments

Comments

@orasimus
Copy link

Hi! Thanks for the commits regarding the path escaping.

The signing still fails if the path contains a :. It gets transformed into %3A earlier and then on line 219:

path.push(encodeRfc3986(querystring.escape(piece)))

querystring.escape turns it into %253A.

So signing calls to e.g. http://domain.com/product/foo:123 fails.

@mhart
Copy link
Owner

mhart commented Dec 30, 2015

@orasimus this is actually how the Amazon services work – you can check it yourself if you like.

@mhart
Copy link
Owner

mhart commented Dec 30, 2015

@orasimus – only S3 will decode the querystring before escaping it again – all the other services do not try to decode entities. And because the character : is disallowed in a URL, it needs to be percent encoded in the path in the first place.

@mhart
Copy link
Owner

mhart commented Dec 30, 2015

@orasimus You can read more info on it all here: aws/aws-sdk-js#853 (comment)

@mhart
Copy link
Owner

mhart commented Dec 30, 2015

@orasimus If you don't wish to have this behaviour because you're testing or using it in your own service, you can use doNotEncodePath: true as an option – this is what I do to get it to pass the test suite: https://github.com/mhart/aws4/blob/master/test/fast.js#L542

@mhart mhart closed this as completed Dec 30, 2015
@orasimus
Copy link
Author

Thanks for the comment. I tried looking at the code yesterday, but I guess it was too early in the morning as I missed that. :)

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

No branches or pull requests

2 participants