You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
fix: removes content-header from AWS IMDS get request (#1934)
When performing a IMDS request, the code incorrectly adds a content-type
header to the request:
`content-type: application/json` to AWS metadata (IMDS) GET requests.`
Some services at AWS (such as AWS SageMaker Jupyter notebook) have a
stricter than normal metadata server (IMDS, both v1 and v2) when it
comes to handling incoming http requests.
This PR removes the default content-header and replaces it with `None`.
NOTE: initializing headers to `None` (instead of an empty `dict`) when
no session token is present matches the existing behavior in
`_get_metadata_role_name` and allows the transport adapter to handle
default headers cleanly.
This PR updates existing unit tests (`tests/test_aws.py`) to match the
new behavior.
NOTE: closing PR #1489 due to inactivity as we make the push to migrate
this library to the `google-cloud-python` monorepo
For more information about the genesis of this, see the following issue:
https://issuetracker.google.com/issues/328089077
0 commit comments