Commit fc015703 authored by Mike Dougherty's avatar Mike Dougherty Committed by Commit Bot

Remove Javascript POST workaround when running on iOS 11 or later

BUG=581021

Change-Id: Id6d7ab0cabc525cd575f6140281fdf5dc213a2b9
Reviewed-on: https://chromium-review.googlesource.com/565786Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485460}
parent 2b0d6d14
......@@ -5057,16 +5057,21 @@ registerLoadRequestForURL:(const GURL&)requestURL
[request setHTTPMethod:@"POST"];
[request setHTTPBody:POSTData];
[request setAllHTTPHeaderFields:self.currentHTTPHeaders];
GURL navigationURL =
currentItem ? currentItem->GetURL() : GURL::EmptyGURL();
std::unique_ptr<web::NavigationContextImpl> navigationContext =
[self registerLoadRequestForURL:navigationURL
referrer:self.currentNavItemReferrer
transition:self.currentTransition];
WKNavigation* navigation = [self loadPOSTRequest:request];
[_navigationStates setContext:std::move(navigationContext)
forNavigation:navigation];
return;
// As of iOS 11, WKWebView supports requests with POST data, so the
// Javascript POST workaround only needs to be used if the OS version is
// less than iOS 11.
if (!base::ios::IsRunningOnIOS11OrLater()) {
GURL navigationURL =
currentItem ? currentItem->GetURL() : GURL::EmptyGURL();
std::unique_ptr<web::NavigationContextImpl> navigationContext =
[self registerLoadRequestForURL:navigationURL
referrer:self.currentNavItemReferrer
transition:self.currentTransition];
WKNavigation* navigation = [self loadPOSTRequest:request];
[_navigationStates setContext:std::move(navigationContext)
forNavigation:navigation];
return;
}
}
ProceduralBlock defaultNavigationBlock = ^{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment