summaryrefslogtreecommitdiff
path: root/chromium/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc')
-rw-r--r--chromium/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chromium/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc b/chromium/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc
index dc342974f9c..efe0bf7cd33 100644
--- a/chromium/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc
+++ b/chromium/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc
@@ -278,7 +278,8 @@ void WebRequestProxyingURLLoaderFactory::InProgressRequest::OnReceiveRedirect(
const net::RedirectInfo& redirect_info,
const network::ResourceResponseHead& head) {
if (redirect_url_ != redirect_info.new_url &&
- !IsRedirectSafe(request_.url, redirect_info.new_url)) {
+ !IsRedirectSafe(request_.url, redirect_info.new_url,
+ info_->is_navigation_request)) {
OnRequestError(
network::URLLoaderCompletionStatus(net::ERR_UNSAFE_REDIRECT));
return;
@@ -829,8 +830,11 @@ void WebRequestProxyingURLLoaderFactory::InProgressRequest::OnRequestError(
// Determines whether it is safe to redirect from |from_url| to |to_url|.
bool WebRequestProxyingURLLoaderFactory::InProgressRequest::IsRedirectSafe(
const GURL& from_url,
- const GURL& to_url) {
- if (to_url.SchemeIs(extensions::kExtensionScheme)) {
+ const GURL& to_url,
+ bool is_navigation_request) {
+ // For navigations, non-web accessible resources will be blocked by
+ // ExtensionNavigationThrottle.
+ if (!is_navigation_request && to_url.SchemeIs(extensions::kExtensionScheme)) {
const Extension* extension =
ExtensionRegistry::Get(factory_->browser_context_)
->enabled_extensions()