diff --git a/google/auth/aws.py b/google/auth/aws.py index 28c065d3c..4ea1b38b8 100644 --- a/google/auth/aws.py +++ b/google/auth/aws.py @@ -531,7 +531,7 @@ def _get_metadata_security_credentials( google.auth.exceptions.RefreshError: If an error occurs while retrieving the AWS security credentials. """ - headers = {"Content-Type": "application/json"} + headers = {} if imdsv2_session_token is not None: headers["X-aws-ec2-metadata-token"] = imdsv2_session_token