-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Update presigner to only hoist headers in v2 presigned URLs #1808
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1808 +/- ##
=========================================
Coverage ? 95.75%
=========================================
Files ? 191
Lines ? 6668
Branches ? 1364
=========================================
Hits ? 6385
Misses ? 283
Partials ? 0
Continue to review full report at Codecov.
|
… pushes and only PRs
32105ca
to
ff90391
Compare
lib/signers/presign.js
Outdated
var parsedUrl = AWS.util.urlParse(request.httpRequest.path); | ||
var queryParams = parsedUrl.search | ||
? AWS.util.queryStringParse(parsedUrl.search.substr(1)) : {}; | ||
queryParams['Expires'] = expires; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like queryParams is used after it's created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove.
|
||
AWS.util.each(request.httpRequest.headers, function (key, value) { | ||
if (key === expiresHeader) key = 'Expires'; | ||
if (key.indexOf('x-amz-meta-') === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if there are any headers that we hoist to the query string today that don't also have to be sent as headers when using sigv4 presigned urls? Maybe that's just a feature of sigv2, but I'm wondering if we'll lose out on that feature with this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are, and they are all handled here. The current V4 presigner will always produce an invalid signature when any other headers are present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. So we may want to add additional headers to that section you pointed to in the future, but as of now, this change won't cause any existing cases to break. This part looks good then!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming travis passes, ship it!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Resolves #1804. All integration tests were run locally and pass.