Skip to content

Commit

Permalink
[FIX] Exclude localhost from hitting proxies for metadata service req…
Browse files Browse the repository at this point in the history
…uests
  • Loading branch information
ilia-db committed Jan 29, 2025
1 parent 4bcfb0a commit 3ba03e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions databricks/sdk/credentials_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,10 @@ def refresh(self) -> Token:
headers={
self.METADATA_SERVICE_VERSION_HEADER: self.METADATA_SERVICE_VERSION,
self.METADATA_SERVICE_HOST_HEADER: self.host
},
proxies={
# Metadata URL usually points to localhost, and the requests package doesn't exclude localhost from proxies by default
"no_proxy": "localhost,127.0.0.1"
})
json_resp: dict[str, Union[str, float]] = resp.json()
access_token = json_resp.get("access_token", None)
Expand Down

0 comments on commit 3ba03e4

Please sign in to comment.