mirror of
https://github.com/apache/jclouds.git
synced 2025-02-16 23:16:58 +00:00
Revert "A 401 error should result in re-authenticating for a new token"
This reverts commit 7b0cd9be43a6035a71652bb5c9f3cd604e18eb9d. References JCLOUDS-231
This commit is contained in:
parent
78e5832fd2
commit
c0a438b671
@ -64,8 +64,8 @@ public class RetryOnRenew implements HttpRetryHandler {
|
||||
retry = false;
|
||||
} else {
|
||||
byte[] content = closeClientButKeepContentStream(response);
|
||||
// Error when the session token expires: HTTP/1.1 401 Unauthorized, no body (or provider-specific response body)
|
||||
if (content != null) {
|
||||
//TODO: what is the error when the session token expires??
|
||||
if (content != null && new String(content).contains("lease renew")) {
|
||||
logger.debug("invalidating authentication token");
|
||||
authenticationResponseCache.invalidateAll();
|
||||
retry = true;
|
||||
|
@ -53,7 +53,7 @@ public class RetryOnRenewTest {
|
||||
cache.invalidateAll();
|
||||
expectLastCall();
|
||||
|
||||
expect(response.getPayload()).andReturn(Payloads.newStringPayload("")).anyTimes();
|
||||
expect(response.getPayload()).andReturn(Payloads.newStringPayload("token expired, please renew")).anyTimes();
|
||||
expect(response.getStatusCode()).andReturn(401).atLeastOnce();
|
||||
|
||||
replay(command);
|
||||
|
Loading…
x
Reference in New Issue
Block a user