diff options
author | horo <horo@chromium.org> | 2014-10-23 16:51:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-23 23:52:07 +0000 |
commit | ee19788135cd12b718feed2550ae5a98dc78abdb (patch) | |
tree | f5ee85442c985590f441d141c46c8310e23d83e7 /content/browser | |
parent | 0e3acae0f32d4eb5e82bd6548e17117e9cb6f4d1 (diff) | |
download | chromium_src-ee19788135cd12b718feed2550ae5a98dc78abdb.zip chromium_src-ee19788135cd12b718feed2550ae5a98dc78abdb.tar.gz chromium_src-ee19788135cd12b718feed2550ae5a98dc78abdb.tar.bz2 |
[ServiceWorker] Check ignore_certificate_errors flag in ServiceWorkerWriteToCacheJob.
https://codereview.chromium.org/643773004 broke LayoutTest fetch-mixed-content.html.
While executing LayoutTest, ignore_certificate_errors is set in LayoutTestBrowserContext.
So every cert errors are ignored in HttpStreamFactoryImpl::Job::HandleCertificateError.
At this case we should also ignore the cert errors in ServiceWorkerWriteToCacheJob.
BUG=426047,425396
Review URL: https://codereview.chromium.org/664343005
Cr-Commit-Position: refs/heads/master@{#300989}
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/service_worker/service_worker_write_to_cache_job.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/content/browser/service_worker/service_worker_write_to_cache_job.cc b/content/browser/service_worker/service_worker_write_to_cache_job.cc index 4a68e01..0baf702a2 100644 --- a/content/browser/service_worker/service_worker_write_to_cache_job.cc +++ b/content/browser/service_worker/service_worker_write_to_cache_job.cc @@ -10,6 +10,7 @@ #include "content/browser/service_worker/service_worker_metrics.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" +#include "net/http/http_network_session.h" #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/http/http_util.h" @@ -346,9 +347,13 @@ void ServiceWorkerWriteToCacheJob::OnResponseStarted( // OnSSLCertificateError is not called when the HTTPS connection is reused. // So we check cert_status here. if (net::IsCertStatusError(request->ssl_info().cert_status)) { - AsyncNotifyDoneHelper(net::URLRequestStatus( - net::URLRequestStatus::FAILED, net::ERR_INSECURE_RESPONSE)); - return; + const net::HttpNetworkSession::Params* session_params = + request->context()->GetNetworkSessionParams(); + if (!session_params || !session_params->ignore_certificate_errors) { + AsyncNotifyDoneHelper(net::URLRequestStatus(net::URLRequestStatus::FAILED, + net::ERR_INSECURE_RESPONSE)); + return; + } } // To prevent most user-uploaded content from being used as a serviceworker. if (version_->script_url() == url_) { |