Skip to content

Commit

Permalink
CachedResonseHeaders should be update in right way
Browse files Browse the repository at this point in the history
  • Loading branch information
zyvincent committed Nov 17, 2017
1 parent 572c059 commit 407b700
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sonic-iOS/Sonic/SonicSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,15 @@ - (void)server:(SonicServer *)server didRecieveResponse:(NSHTTPURLResponse *)res
NSArray *cookiesFromResp = [NSHTTPCookie cookiesWithResponseHeaderFields:response.allHeaderFields forURL:response.URL];
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:cookiesFromResp forURL:response.URL mainDocumentURL:self.sonicServer.request.mainDocumentURL];
});
self.cacheResponseHeaders = response.allHeaderFields;
if (self.isFirstLoad) {
[self firstLoadRecieveResponse:response];
}else{
if ([self.sonicServer isSonicResponse] && !self.configuration.enableLocalServer) {
self.cacheResponseHeaders = response.allHeaderFields;
}
if (self.configuration.enableLocalServer) {
self.cacheResponseHeaders = response.allHeaderFields;
}
}
};
NSString *opIdentifier = dispatchToSonicSessionQueue(opBlock);
Expand Down

0 comments on commit 407b700

Please sign in to comment.