diff --git a/src/anthropic/lib/bedrock/_auth.py b/src/anthropic/lib/bedrock/_auth.py index 0a8b2109..a49930db 100644 --- a/src/anthropic/lib/bedrock/_auth.py +++ b/src/anthropic/lib/bedrock/_auth.py @@ -56,10 +56,9 @@ def get_auth_headers( # The connection header may be stripped by a proxy somewhere, so the receiver # of this message may not see this header, so we remove it from the set of headers # that are signed. - headers = headers.copy() - del headers["connection"] + new_headers = {k: v for k, v in dict(headers).items() if k.lower() != "connection"} - request = AWSRequest(method=method.upper(), url=url, headers=headers, data=data) + request = AWSRequest(method=method.upper(), url=url, headers=new_headers, data=data) credentials = session.get_credentials() if not credentials: raise RuntimeError("could not resolve credentials from session")