HttpRequest: Apparently fContext can be NULL. CID 1162798
This commit is contained in:
@@ -834,6 +834,7 @@ BHttpRequest::_SendHeaders()
|
||||
fOutputHeaders.AddHeader("Referer", fOptReferer.String());
|
||||
|
||||
// Authentication
|
||||
if (fContext != NULL) {
|
||||
BHttpAuthentication& authentication = fContext->GetAuthentication(fUrl);
|
||||
if (authentication.Method() != B_HTTP_AUTHENTICATION_NONE) {
|
||||
if (fOptUsername.Length() > 0) {
|
||||
@@ -845,6 +846,7 @@ BHttpRequest::_SendHeaders()
|
||||
fOutputHeaders.AddHeader("Authorization",
|
||||
authentication.Authorization(fUrl, request));
|
||||
}
|
||||
}
|
||||
|
||||
// Required headers for POST data
|
||||
if (fOptPostFields != NULL && fRequestMethod == B_HTTP_POST) {
|
||||
@@ -890,7 +892,7 @@ BHttpRequest::_SendHeaders()
|
||||
}
|
||||
|
||||
// Context cookies
|
||||
if (fOptSetCookies && (fContext != NULL)) {
|
||||
if (fOptSetCookies && fContext != NULL) {
|
||||
BNetworkCookie* cookie;
|
||||
BString cookieString;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user