Index: Source/modules/fetch/FetchManager.cpp |
diff --git a/Source/modules/fetch/FetchManager.cpp b/Source/modules/fetch/FetchManager.cpp |
index 4f0650c0000189d77c29dfb5ff630218d65a5c28..29b2f61ea1404304127a1d3fe565bbd53ff39aa9 100644 |
--- a/Source/modules/fetch/FetchManager.cpp |
+++ b/Source/modules/fetch/FetchManager.cpp |
@@ -360,7 +360,7 @@ void FetchManager::Loader::performHTTPFetch(bool corsFlag, bool corsPreflightFla |
// We use ResourceRequest class for HTTPRequest. |
// FIXME: Support body. |
ResourceRequest request(m_request->url()); |
- request.setRequestContext(WebURLRequest::RequestContextFetch); |
+ request.setRequestContext(m_request->context()); |
request.setHTTPMethod(m_request->method()); |
const Vector<OwnPtr<FetchHeaderList::Header>>& list = m_request->headerList()->list(); |
for (size_t i = 0; i < list.size(); ++i) { |
@@ -469,6 +469,8 @@ ScriptPromise FetchManager::fetch(ScriptState* scriptState, FetchRequestData* re |
RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState); |
ScriptPromise promise = resolver->promise(); |
+ request->setContext(WebURLRequest::RequestContextFetch); |
+ |
OwnPtrWillBeRawPtr<Loader> ownLoader = Loader::create(m_executionContext, this, resolver.release(), request); |
Loader* loader = m_loaders.add(ownLoader.release()).storedValue->get(); |
loader->start(); |