RestKit/RestKit — pull request #496 by rayfix (2012-01-09 08:07:48+00:00)
Title: Fix for ocassional crashes using http basic auth

Testing a server staged on Heroku, I have been getting occasional crashes with HTTP Basic Authentication even though my username/password are set.

In my case authorizationString sometimes fails to copy the header "Authorization" and this ultimately results in a crash when CFRelease is called on a NULL authorizationString.

```
CFStringRef authorizationString = CFHTTPMessageCopyHeaderFieldValue(dummyRequest, CFSTR("Authorization"));
```

The documentation states that CFHTTPMessageCopyHeaderValue can return NULL if the header is not found, and since CFRelease results in your program crashing when passed a NULL, I think some conditionals are appropriate.

I guess we might also consider putting in some debug logging with the expected headers are not present but I would settle for not crashing. :)