-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add whitelisting to headers for S3 presigning #2110
Conversation
'referer', | ||
'te', | ||
'user-agent' | ||
].freeze |
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.
i removed 'x-amzn-trace-id' because the signer will add it for you:
@unsigned_headers << 'x-amzn-trace-id'
@@ -361,7 +361,6 @@ def sign_event(prior_signature, payload, encoder) | |||
# `:body_digest` in place of passing `:body`. | |||
# | |||
# @option options [Time] :time (Time.now) Time of the signature. | |||
# You should only set this value for testing. |
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.
this wasn't true anymore!
b122e04
to
9fa7230
Compare
@@ -116,7 +109,22 @@ module S3 | |||
time: Time.utc(1969, 4, 20) | |||
} | |||
actual_url = pre.presigned_url(:get_object, params) | |||
expect(actual_url).to eq(expected_url) | |||
expect(actual_url).to include(date_time) |
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.
Just a side note, not required, I'd prefer a more clear &X-Amz-Date=19690420T000000Z
match or &X-Amz-SignedHeaders=host&user-agent
,
9fa7230
to
396840f
Compare
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
closes #2098