I want to base64-encode a username and password (i.e. I want it as a
string), and I thought it would be cool to do that with CF functions
(so I don't have to write the whole base64 stuff, or download some
hacked-together library for that).
I create a CFHTTPMessageRef with ...CreateResponse(..., 401,...). I
set its header field to the usual WWW-authenticate record; I set its
body to an NSData from an empty string.
I do the same to create a request (with a random URL).
When I call CFHTTPMessageAddAuthentication(request, response, myUser,
myPass, kCFHTTPAuthenticationSchemeBasic, FALSE), I get a crash.
(afterwards, I would have extracted the header value to get my string)
Does anybody have an idea why? After all, I created nice, clean
HTTPMessage objects with Apple's own functions, and I even set all
their values...
brianhray@gmail.com - 27 Nov 2006 15:51 GMT
Maybe something you pass in to make the CFHTTPMessageRef is NULL. Its
really hard to tell with the information you gave. If you still have
the problem, why don't you print out the call stack and some code to
reproduce?
-- Brian Ray (http://kazavoo.com)