fix(bedrock/base_aws_llm): fix Authorization override guard after header normalization

After lowercasing all header keys, the Authorization override guard was
checking for uppercase "Authorization" (always False) and the key
lookup would also fail. Update both to use lowercase "authorization" to
match the post-normalization dict.

Caught by Greptile review on PR #28257.
This commit is contained in:
Connor Graham 2026-05-19 10:51:42 -04:00
parent 9c4c27f6d5
commit 1c9af0428a

View file

@ -1523,9 +1523,7 @@ class BaseAWSLLM:
for header_name, header_value in headers.items():
if header_value is not None:
request_headers_dict[header_name] = header_value
if (
headers is not None and "Authorization" in headers
): # prevent sigv4 from overwriting the auth header
request_headers_dict["Authorization"] = headers["Authorization"]
if "authorization" in headers: # prevent sigv4 from overwriting the auth header
request_headers_dict["Authorization"] = headers["authorization"]
return request_headers_dict, request.body