-
Notifications
You must be signed in to change notification settings - Fork 9
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
Use RFC 3986 query encoding #33
Conversation
Pull Request Test Coverage Report for Build 47219f3cc5012fef811aaa591cfa2aa593adb57c-PR-33
💛 - Coveralls |
I see... is this somehow related to #16? |
Probably, I have not used v2 but I can imagine that the encoding should also be RFC3986 and not |
I've checked and my tests fail when I use v2. The reason is that #16 missed a clause and the signature was not encoded at all. I pushed a commit that fixes this and changes the encoding to the more recommended RFC 3986 encoding. |
Perfect, thank you for your contribution, @dvic! 👍 |
@dvic any chance you could share how you are calling |
@atomkirk we use the following query_params: [
"response-content-disposition": ~s[attachment; filename="#{filename}"],
] |
interesting. I'm doing that exact same thing and it's not working. If i remove query_params then it creates a link that works. I'll keep digging. Thanks for the response. |
We stumbled upon this issue when we used the
response-content-disposition
query parameter (https://cloud.google.com/storage/docs/xml-api/reference-headers#responsecontentdisposition). Without this PR, the signed URL is rejected by Google. Upon further inspection we noticed that Google encoded the space character as%20
, while the library encoded it as+
.This PR changes the query encoding to follow RFC 3986, which, among other things, means that spaces are encoded as
%20
instead of+
.