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

Fix unconditional key removal from request.headers #2948

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion botocore/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def _get_body_as_dict(request):
data = json.loads(data)
return data

def _replace_header(headers, key, value):

thejcannon marked this conversation as resolved.
Show resolved Hide resolved

class BaseSigner:
REQUIRES_REGION = False
Expand Down Expand Up @@ -815,7 +817,8 @@ def get_signature(
self, method, split, headers, expires=None, auth_path=None
):
if self.credentials.token:
del headers['x-amz-security-token']
if 'X-Amz-Security-Token' in request.headers:
del request.headers['X-Amz-Security-Token']
headers['x-amz-security-token'] = self.credentials.token
string_to_sign = self.canonical_string(
method, split, headers, auth_path=auth_path
Expand Down