| Index: content/child/web_url_loader_impl.cc
|
| diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
|
| index 2b9d783dc2f095bfb18439cbf41a802a624a32c9..414b8d9ec5434b7425cb896017be4da41e91f14a 100644
|
| --- a/content/child/web_url_loader_impl.cc
|
| +++ b/content/child/web_url_loader_impl.cc
|
| @@ -539,8 +539,22 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
|
| request_info.report_raw_headers = request.reportRawHeaders();
|
| request_info.loading_web_task_runner.reset(web_task_runner_->clone());
|
|
|
| - scoped_refptr<ResourceRequestBody> request_body =
|
| - GetRequestBodyForWebURLRequest(request).get();
|
| + // If the request has an attached credential, then use it as the
|
| + // |request_body| and ensure that the service worker will be presented
|
| + // with a Request whose body is empty.
|
| + //
|
| + // This doesn't line up with the way the spec is written (see
|
| + // https://w3c.github.io/webappsec-credential-management/#monkey-patching)
|
| + // but it has the advantage of actually working with our architechture.
|
| + scoped_refptr<ResourceRequestBody> request_body;
|
| + if (!request.attachedCredentialBody().isNull()) {
|
| + request_body =
|
| + GetRequestBodyForWebURLRequest(request, CREDENTIAL_BODY).get();
|
| + request_info.empty_body_in_service_worker = true;
|
| + } else {
|
| + request_body = GetRequestBodyForWebURLRequest(request, HTTP_BODY).get();
|
| + request_info.empty_body_in_service_worker = false;
|
| + }
|
|
|
| // PlzNavigate: during navigation, the renderer should request a stream which
|
| // contains the body of the response. The network request has already been
|
| @@ -553,8 +567,8 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
|
| }
|
|
|
| if (sync_load_response) {
|
| - resource_dispatcher_->StartSync(
|
| - request_info, request_body.get(), sync_load_response);
|
| + resource_dispatcher_->StartSync(request_info, request_body.get(),
|
| + sync_load_response);
|
| return;
|
| }
|
|
|
|
|