Permalink
Browse files

RKRequest: Added null check for HTTP Basic username and password. Closes

  • Loading branch information...
DavidYKay authored and blakewatters committed Jan 5, 2012
1 parent 89a4e57 commit 6a18ebd91bb010938918a6a02904ee32deeecf56
Showing with 1 addition and 1 deletion.
  1. +1 −1 Code/Network/RKRequest.m
View
@@ -232,7 +232,7 @@ - (void)addHeadersToRequest {
}
// Add authentication headers so we don't have to deal with an extra cycle for each message requiring basic auth.
- if (self.authenticationType == RKRequestAuthenticationTypeHTTPBasic) {
+ if (self.authenticationType == RKRequestAuthenticationTypeHTTPBasic && _username && _password) {
CFHTTPMessageRef dummyRequest = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)[self HTTPMethod], (CFURLRef)[self URL], kCFHTTPVersion1_1);
CFHTTPMessageAddAuthentication(dummyRequest, nil, (CFStringRef)_username, (CFStringRef)_password,kCFHTTPAuthenticationSchemeBasic, FALSE);

0 comments on commit 6a18ebd

Please sign in to comment.