diff --git a/Objective-C/Internal/Replicator/CBLHTTPLogic.m b/Objective-C/Internal/Replicator/CBLHTTPLogic.m index 203f2e7a2..65c7db8d1 100644 --- a/Objective-C/Internal/Replicator/CBLHTTPLogic.m +++ b/Objective-C/Internal/Replicator/CBLHTTPLogic.m @@ -206,7 +206,7 @@ - (CFHTTPMessageRef) newHTTPRequest { } // Add authentication: - if (_responseMsg && _credential.user && !(_proxyType == kCBLHTTPProxy && _useProxyCONNECT)) { + if (_credential.user && !(_proxyType == kCBLHTTPProxy && _useProxyCONNECT)) { if (![self addAuthentication: _credential toRequest: httpMsg forProxy: false]) _credential = nil; } @@ -288,16 +288,6 @@ - (void) receivedResponse: (CFHTTPMessageRef)response { case 401: { NSString* authResponse = getHeader(_responseMsg, @"WWW-Authenticate"); - if (!_authorizationHeader) { - if (!_credential) - _credential = [self credentialForAuthHeader: authResponse]; - CBLLog(WebSocket, @"%@: Auth challenge; credential = %@", self, _credential); - if (_credential) { - // Recoverable auth failure -- try again with new _credential: - _shouldRetry = YES; - break; - } - } CBLLog(WebSocket, @"%@: HTTP auth failed; sent Authorization: %@ ; got WWW-Authenticate: %@", self, _authorizationHeader, authResponse); NSDictionary* challengeInfo = [[self class] parseAuthHeader: authResponse];