diff --git a/google/auth/aws.py b/google/auth/aws.py index 8e6c6789c..ba91f70b3 100644 --- a/google/auth/aws.py +++ b/google/auth/aws.py @@ -530,7 +530,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