Browse Source

Merge "Fix to use renewal keystone token when re-authenticated"

tags/2015.1.0b3^0
Jenkins 4 years ago
parent
commit
cc6e5951cc

+ 3
- 3
hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java View File

@@ -1804,10 +1804,10 @@ public final class SwiftRestClient {
1804 1804
    * @param accessToken access token
1805 1805
    * @throws SwiftInternalStateException if the client is not yet authenticated
1806 1806
    */
1807
-  private void setAuthToken(HttpMethodBase method, AccessToken accessToken)
1807
+  private void setAuthToken(HttpMethod method, AccessToken accessToken)
1808 1808
       throws SwiftInternalStateException {
1809 1809
     checkNotNull(accessToken,"Not authenticated");
1810
-    method.addRequestHeader(HEADER_AUTH_KEY, accessToken.getId());
1810
+    method.setRequestHeader(HEADER_AUTH_KEY, accessToken.getId());
1811 1811
   }
1812 1812
 
1813 1813
   /**
@@ -1859,7 +1859,7 @@ public final class SwiftRestClient {
1859 1859
         LOG.debug("Reauthenticating");
1860 1860
       }
1861 1861
       //re-auth, this may recurse into the same dir
1862
-      authenticate();
1862
+      setAuthToken(method, authenticate());
1863 1863
       if (LOG.isDebugEnabled()) {
1864 1864
         LOG.debug("Retrying original request");
1865 1865
       }

Loading…
Cancel
Save