فهرست منبع

[abfs] Do not try to set credentials headers when Raz is on

Romain Rigaux 4 سال پیش
والد
کامیت
e9175a9617
1فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 6 2
      desktop/libs/azure/src/azure/abfs/abfs.py

+ 6 - 2
desktop/libs/azure/src/azure/abfs/abfs.py

@@ -129,11 +129,15 @@ class ABFS(object):
       return resource.Resource(http_client.HttpClient(url, exc_class=WebHdfsException, logger=LOG))
       return resource.Resource(http_client.HttpClient(url, exc_class=WebHdfsException, logger=LOG))
 
 
   def _getheaders(self):
   def _getheaders(self):
-    return {
-      "Authorization": self._token_type + " " + self._access_token,
+    headers = {
       "x-ms-version" : "2019-02-02" # Note: this is required for setaccesscontrols
       "x-ms-version" : "2019-02-02" # Note: this is required for setaccesscontrols
     }
     }
 
 
+    if self._token_type and self._access_token:
+      headers["Authorization"] = self._token_type + " " + self._access_token
+
+    return headers
+
   @property
   @property
   def superuser(self):
   def superuser(self):
     return self._superuser
     return self._superuser