Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasMerz committed Jul 26, 2021
1 parent 403c930 commit a5e4339
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ios/WebviewProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ - (BOOL) overrideSchemeTask: (id <WKURLSchemeTask>)urlSchemeTask {

// Request should be handled by this plugin if the url contains the proxy path
if ([stringToLoad hasPrefix:@"/_http_proxy_"]||[stringToLoad hasPrefix:@"/_https_proxy_"]) {
// Firt sync all cookies from the WKHTTPCookieStore to the NSHTTPCookieStorage..
// .. to solve make cookies set in the main or IAB webview available for proxy requests
// First sync all cookies from the WKHTTPCookieStore to the NSHTTPCookieStorage..
// .. to make cookies from main or IAB webview available for proxy requests
WKWebsiteDataStore* dataStore = [WKWebsiteDataStore defaultDataStore];
WKHTTPCookieStore* cookieStore = dataStore.httpCookieStore;
[cookieStore getAllCookies:^(NSArray* cookies) {
Expand Down Expand Up @@ -71,7 +71,7 @@ - (BOOL) overrideSchemeTask: (id <WKURLSchemeTask>)urlSchemeTask {
}
}

// Copy cookies from the native requests cookie storage to the webviews cookie storage
// Copy cookies from the native requests cookie storage to other cookie storage to make them available to the webviews
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
if(httpResponse) {
NSArray* cookies = [NSHTTPCookie cookiesWithResponseHeaderFields:[httpResponse allHeaderFields] forURL:response.URL];
Expand Down

0 comments on commit a5e4339

Please sign in to comment.