Skip to content
Browse files

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

…ses #493.
  • Loading branch information...
1 parent 89a4e57 commit 6a18ebd91bb010938918a6a02904ee32deeecf56 @DavidYKay DavidYKay committed with blakewatters
Showing with 1 addition and 1 deletion.
  1. +1 −1 Code/Network/RKRequest.m
View
2 Code/Network/RKRequest.m
@@ -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.
Something went wrong with that request. Please try again.