Ben Copsey

Fix session credentials matching

@@ -2153,7 +2153,7 @@ static NSRecursiveLock *delegateAuthenticationLock = nil; @@ -2153,7 +2153,7 @@ static NSRecursiveLock *delegateAuthenticationLock = nil;
2153 [sessionCredentialsLock lock]; 2153 [sessionCredentialsLock lock];
2154 NSMutableArray *sessionCredentialsList = [[self class] sessionProxyCredentialsStore]; 2154 NSMutableArray *sessionCredentialsList = [[self class] sessionProxyCredentialsStore];
2155 for (NSDictionary *theCredentials in sessionCredentialsList) { 2155 for (NSDictionary *theCredentials in sessionCredentialsList) {
2156 - if ([[theCredentials objectForKey:@"Host"] isEqualTo:[self proxyHost]] && [[theCredentials objectForKey:@"Port"] intValue] == [self proxyPort]) { 2156 + if ([[theCredentials objectForKey:@"Host"] isEqualToString:[self proxyHost]] && [[theCredentials objectForKey:@"Port"] intValue] == [self proxyPort]) {
2157 [sessionCredentialsLock unlock]; 2157 [sessionCredentialsLock unlock];
2158 return theCredentials; 2158 return theCredentials;
2159 } 2159 }
@@ -2169,8 +2169,8 @@ static NSRecursiveLock *delegateAuthenticationLock = nil; @@ -2169,8 +2169,8 @@ static NSRecursiveLock *delegateAuthenticationLock = nil;
2169 NSMutableArray *sessionCredentialsList = [[self class] sessionCredentialsStore]; 2169 NSMutableArray *sessionCredentialsList = [[self class] sessionCredentialsStore];
2170 // Find an exact match 2170 // Find an exact match
2171 for (NSDictionary *theCredentials in sessionCredentialsList) { 2171 for (NSDictionary *theCredentials in sessionCredentialsList) {
2172 - if ([[theCredentials objectForKey:@"URL"] isEqualTo:[self url]]) { 2172 + if ([[theCredentials objectForKey:@"URL"] isEqual:[self url]]) {
2173 - if (![self responseStatusCode] || [[theCredentials objectForKey:@"AuthenticationRealm"] isEqualTo:[self authenticationRealm]]) { 2173 + if (![self responseStatusCode] || [[theCredentials objectForKey:@"AuthenticationRealm"] isEqualToString:[self authenticationRealm]]) {
2174 [sessionCredentialsLock unlock]; 2174 [sessionCredentialsLock unlock];
2175 return theCredentials; 2175 return theCredentials;
2176 } 2176 }
@@ -2180,8 +2180,8 @@ static NSRecursiveLock *delegateAuthenticationLock = nil; @@ -2180,8 +2180,8 @@ static NSRecursiveLock *delegateAuthenticationLock = nil;
2180 NSURL *requestURL = [self url]; 2180 NSURL *requestURL = [self url];
2181 for (NSDictionary *theCredentials in sessionCredentialsList) { 2181 for (NSDictionary *theCredentials in sessionCredentialsList) {
2182 NSURL *theURL = [theCredentials objectForKey:@"URL"]; 2182 NSURL *theURL = [theCredentials objectForKey:@"URL"];
2183 - if ([[theURL host] isEqualTo:[requestURL host]] && [[theURL port] isEqualTo:[requestURL port]] && [[theURL scheme] isEqualTo:[requestURL scheme]]) { 2183 + if ([[theURL host] isEqualToString:[requestURL host]] && [[theURL port] isEqualToNumber:[requestURL port]] && [[theURL scheme] isEqualToString:[requestURL scheme]]) {
2184 - if (![self responseStatusCode] || [[theCredentials objectForKey:@"AuthenticationRealm"] isEqualTo:[self authenticationRealm]]) { 2184 + if (![self responseStatusCode] || [[theCredentials objectForKey:@"AuthenticationRealm"] isEqualToString:[self authenticationRealm]]) {
2185 [sessionCredentialsLock unlock]; 2185 [sessionCredentialsLock unlock];
2186 return theCredentials; 2186 return theCredentials;
2187 } 2187 }