mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Apply patches by Lubomir Rintel <lubo.rintel@gooddata.com> to enable cookies
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34746 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
28d4991154
commit
88d0763339
6 changed files with 105 additions and 14 deletions
|
@ -976,6 +976,26 @@ static NSURLProtocol *placeholder = nil;
|
|||
{
|
||||
NSURLCacheStoragePolicy policy;
|
||||
|
||||
/* Get cookies from the response and accept them into
|
||||
* shared storage if policy permits
|
||||
*/
|
||||
if ([this->request HTTPShouldHandleCookies] == YES
|
||||
&& [_response isKindOfClass: [NSHTTPURLResponse class]] == YES)
|
||||
{
|
||||
NSDictionary *hdrs;
|
||||
NSArray *cookies;
|
||||
NSURL *url;
|
||||
|
||||
url = [_response URL];
|
||||
hdrs = [_response allHeaderFields];
|
||||
cookies = [NSHTTPCookie cookiesWithResponseHeaderFields: hdrs
|
||||
forURL: url];
|
||||
[[NSHTTPCookieStorage sharedHTTPCookieStorage]
|
||||
setCookies: cookies
|
||||
forURL: url
|
||||
mainDocumentURL: [this->request mainDocumentURL]];
|
||||
}
|
||||
|
||||
/* Tell the client that we have a response and how
|
||||
* it should be cached.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue