Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/adib/asi-http-request int…
Browse files Browse the repository at this point in the history
…o adib-master
  • Loading branch information
pokeb committed Feb 5, 2011
2 parents fd63cc2 + 85199a5 commit 32c6531
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Classes/ASIHTTPRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -2403,6 +2403,30 @@ - (NSMutableDictionary *)findProxyCredentials

// If we have a username and password, let's apply them to the request and continue
if (user && pass) {
// --- BEGIN adib 7-Jan-2011
// set domain for NTLM
{
NSString* authScheme = [self proxyAuthenticationScheme];
if ([authScheme isEqualToString:(NSString*) kCFHTTPAuthenticationSchemeNTLM]) {
NSString* ntlmDomain = [self proxyDomain];
if (!ntlmDomain || [ntlmDomain length] == 0) {
// try to extract the domain from the user name if its in the form DOMAIN\username
NSArray* ntlmComponents = [user componentsSeparatedByString:@"\\"];
if (ntlmComponents.count == 2) {
NSString* domainName = [ntlmComponents objectAtIndex:0];
NSString* userName = [ntlmComponents objectAtIndex:1];

user = userName;
ntlmDomain = domainName;
}
}
if (ntlmDomain) {
[newCredentials setObject:ntlmDomain forKey: (NSString*) kCFHTTPAuthenticationAccountDomain];
}
}

}
// --- END adib 7-Jan-2011

[newCredentials setObject:user forKey:(NSString *)kCFHTTPAuthenticationUsername];
[newCredentials setObject:pass forKey:(NSString *)kCFHTTPAuthenticationPassword];
Expand Down

0 comments on commit 32c6531

Please sign in to comment.