瀏覽代碼

[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))
 
   def _getheaders(self):
-    return {
-      "Authorization": self._token_type + " " + self._access_token,
+    headers = {
       "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
   def superuser(self):
     return self._superuser