* Source/NSURLProtocol.m (_got): Parse cookies from response
---
Source/NSURLProtocol.m | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/Source/NSURLProtocol.m b/Source/NSURLProtocol.m
index bbafbbd..16423eb 100644
--- a/Source/NSURLProtocol.m
+++ b/Source/NSURLProtocol.m
@@ -976,6 +976,20 @@ 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)
+ {
+ [[NSHTTPCookieStorage sharedHTTPCookieStorage]
+ setCookies:[NSHTTPCookie
+ cookiesWithResponseHeaderFields:[_response
allHeaderFields]
+ forURL:[_response URL]]
+ forURL:[_response URL]
+ mainDocumentURL:[this->request mainDocumentURL]];
+ }
+
/* Tell the client that we have a response and how
* it should be cached.
*/
--
1.7.1
_______________________________________________
Bug-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-gnustep