File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -676,12 +676,17 @@ def __init__(self, cfg: 'Config'):
676676 self .host = cfg .host
677677
678678 def refresh (self ) -> Token :
679- resp = requests .get (self .url ,
680- timeout = self ._metadata_service_timeout ,
681- headers = {
682- self .METADATA_SERVICE_VERSION_HEADER : self .METADATA_SERVICE_VERSION ,
683- self .METADATA_SERVICE_HOST_HEADER : self .host
684- })
679+ resp = requests .get (
680+ self .url ,
681+ timeout = self ._metadata_service_timeout ,
682+ headers = {
683+ self .METADATA_SERVICE_VERSION_HEADER : self .METADATA_SERVICE_VERSION ,
684+ self .METADATA_SERVICE_HOST_HEADER : self .host
685+ },
686+ proxies = {
687+ # Metadata URL usually points to localhost, and the requests package doesn't exclude localhost from proxies by default
688+ "no_proxy" : "localhost,127.0.0.1"
689+ })
685690 json_resp : dict [str , Union [str , float ]] = resp .json ()
686691 access_token = json_resp .get ("access_token" , None )
687692 if access_token is None :
You can’t perform that action at this time.
0 commit comments