Skip to content

Commit 3ba03e4

Browse files
committed
[FIX] Exclude localhost from hitting proxies for metadata service requests
1 parent 4bcfb0a commit 3ba03e4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

databricks/sdk/credentials_provider.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,10 @@ def refresh(self) -> Token:
681681
headers={
682682
self.METADATA_SERVICE_VERSION_HEADER: self.METADATA_SERVICE_VERSION,
683683
self.METADATA_SERVICE_HOST_HEADER: self.host
684+
},
685+
proxies={
686+
# Metadata URL usually points to localhost, and the requests package doesn't exclude localhost from proxies by default
687+
"no_proxy": "localhost,127.0.0.1"
684688
})
685689
json_resp: dict[str, Union[str, float]] = resp.json()
686690
access_token = json_resp.get("access_token", None)

0 commit comments

Comments
 (0)