Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: third_party/WebKit/Source/modules/fetch/FetchManager.cpp

Issue 1868253002: Fetch: 'password' credentials mode should include credentials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/fetch/FetchManager.h" 5 #include "modules/fetch/FetchManager.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8ThrowException.h" 10 #include "bindings/core/v8/V8ThrowException.h"
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 // header list." 595 // header list."
596 // We set Origin header in updateRequestForAccessControl() called from 596 // We set Origin header in updateRequestForAccessControl() called from
597 // DocumentThreadableLoader::makeCrossOriginAccessRequest 597 // DocumentThreadableLoader::makeCrossOriginAccessRequest
598 598
599 // "5. Let |credentials flag| be set if either |HTTPRequest|'s credentials 599 // "5. Let |credentials flag| be set if either |HTTPRequest|'s credentials
600 // mode is |include|, or |HTTPRequest|'s credentials mode is |same-origin| 600 // mode is |include|, or |HTTPRequest|'s credentials mode is |same-origin|
601 // and the |CORS flag| is unset, and unset otherwise. 601 // and the |CORS flag| is unset, and unset otherwise.
602 ResourceLoaderOptions resourceLoaderOptions; 602 ResourceLoaderOptions resourceLoaderOptions;
603 resourceLoaderOptions.dataBufferingPolicy = DoNotBufferData; 603 resourceLoaderOptions.dataBufferingPolicy = DoNotBufferData;
604 if (m_request->credentials() == WebURLRequest::FetchCredentialsModeInclude 604 if (m_request->credentials() == WebURLRequest::FetchCredentialsModeInclude
605 || m_request->credentials() == WebURLRequest::FetchCredentialsModePasswo rd
Mike West 2016/04/08 18:49:25 *sobs*
605 || (m_request->credentials() == WebURLRequest::FetchCredentialsModeSameO rigin && !corsFlag)) { 606 || (m_request->credentials() == WebURLRequest::FetchCredentialsModeSameO rigin && !corsFlag)) {
606 resourceLoaderOptions.allowCredentials = AllowStoredCredentials; 607 resourceLoaderOptions.allowCredentials = AllowStoredCredentials;
607 } 608 }
608 if (m_request->credentials() == WebURLRequest::FetchCredentialsModeInclude) 609 if (m_request->credentials() == WebURLRequest::FetchCredentialsModeInclude
610 || m_request->credentials() == WebURLRequest::FetchCredentialsModePasswo rd) {
Mike West 2016/04/08 18:49:25 *more sobs*
609 resourceLoaderOptions.credentialsRequested = ClientRequestedCredentials; 611 resourceLoaderOptions.credentialsRequested = ClientRequestedCredentials;
612 }
610 resourceLoaderOptions.securityOrigin = m_request->origin().get(); 613 resourceLoaderOptions.securityOrigin = m_request->origin().get();
611 614
612 ThreadableLoaderOptions threadableLoaderOptions; 615 ThreadableLoaderOptions threadableLoaderOptions;
613 threadableLoaderOptions.contentSecurityPolicyEnforcement = ContentSecurityPo licy::shouldBypassMainWorld(m_executionContext) ? DoNotEnforceContentSecurityPol icy : EnforceContentSecurityPolicy; 616 threadableLoaderOptions.contentSecurityPolicyEnforcement = ContentSecurityPo licy::shouldBypassMainWorld(m_executionContext) ? DoNotEnforceContentSecurityPol icy : EnforceContentSecurityPolicy;
614 if (corsPreflightFlag) 617 if (corsPreflightFlag)
615 threadableLoaderOptions.preflightPolicy = ForcePreflight; 618 threadableLoaderOptions.preflightPolicy = ForcePreflight;
616 switch (m_request->mode()) { 619 switch (m_request->mode()) {
617 case WebURLRequest::FetchRequestModeSameOrigin: 620 case WebURLRequest::FetchRequestModeSameOrigin:
618 threadableLoaderOptions.crossOriginRequestPolicy = DenyCrossOriginReques ts; 621 threadableLoaderOptions.crossOriginRequestPolicy = DenyCrossOriginReques ts;
619 break; 622 break;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 loader->dispose(); 739 loader->dispose();
737 } 740 }
738 741
739 DEFINE_TRACE(FetchManager) 742 DEFINE_TRACE(FetchManager)
740 { 743 {
741 visitor->trace(m_loaders); 744 visitor->trace(m_loaders);
742 ContextLifecycleObserver::trace(visitor); 745 ContextLifecycleObserver::trace(visitor);
743 } 746 }
744 747
745 } // namespace blink 748 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698