mirror of
https://review.haiku-os.org/haiku
synced 2025-01-24 07:14:48 +01:00
UrlProtocolHttp: parse received cookies
* We didn't do anything with cookies received from the server, they are now automatically added to the cookie jar. * Also make sure the UrlContext (which holds the cookie jar) is forwarded from UrlRequest to UrlProtocol when it gets set. this gets cookies working in Service Kit-based WebKit.
This commit is contained in:
parent
41e940ca3b
commit
a8dd17c9b9
@ -508,6 +508,10 @@ BUrlProtocolHttp::_MakeRequest()
|
||||
if ((fContext != NULL) && fHeaders.HasHeader("Set-Cookie")) {
|
||||
for (int32 i = 0; i < fHeaders.CountHeaders(); i++) {
|
||||
if (fHeaders.HeaderAt(i).NameIs("Set-Cookie")) {
|
||||
BNetworkCookie* cookie = new BNetworkCookie();
|
||||
cookie->ParseCookieStringFromUrl(
|
||||
fHeaders.HeaderAt(i).Value(), fUrl);
|
||||
fContext->GetCookieJar().AddCookie(cookie);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,9 @@ void
|
||||
BUrlRequest::SetContext(BUrlContext* context)
|
||||
{
|
||||
fContext = context;
|
||||
|
||||
if (fUrlProtocol != NULL)
|
||||
fUrlProtocol->SetContext(context);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user