Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…ses #493.
  • Loading branch information...
commit 6a18ebd91bb010938918a6a02904ee32deeecf56 1 parent 89a4e57
@DavidYKay DavidYKay authored blakewatters committed
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);
Please sign in to comment.
Something went wrong with that request. Please try again.