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

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

Issue 2787003002: Fetch API: Stop lowercasing header names. (Closed)
Patch Set: Fix failing tests Created 3 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 <memory> 7 #include <memory>
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 719
720 // "1. Let |HTTPRequest| be a copy of |request|, except that |HTTPRequest|'s 720 // "1. Let |HTTPRequest| be a copy of |request|, except that |HTTPRequest|'s
721 // body is a tee of |request|'s body." 721 // body is a tee of |request|'s body."
722 // We use ResourceRequest class for HTTPRequest. 722 // We use ResourceRequest class for HTTPRequest.
723 // FIXME: Support body. 723 // FIXME: Support body.
724 ResourceRequest request(m_request->url()); 724 ResourceRequest request(m_request->url());
725 request.setRequestContext(m_request->context()); 725 request.setRequestContext(m_request->context());
726 request.setHTTPMethod(m_request->method()); 726 request.setHTTPMethod(m_request->method());
727 request.setFetchRequestMode(m_request->mode()); 727 request.setFetchRequestMode(m_request->mode());
728 request.setFetchCredentialsMode(m_request->credentials()); 728 request.setFetchCredentialsMode(m_request->credentials());
729 const Vector<std::unique_ptr<FetchHeaderList::Header>>& list = 729 for (const auto& header : m_request->headerList()->list()) {
730 m_request->headerList()->list(); 730 request.addHTTPHeaderField(AtomicString(header.first),
731 for (size_t i = 0; i < list.size(); ++i) { 731 AtomicString(header.second));
732 request.addHTTPHeaderField(AtomicString(list[i]->first),
733 AtomicString(list[i]->second));
734 } 732 }
735 733
736 if (m_request->method() != HTTPNames::GET && 734 if (m_request->method() != HTTPNames::GET &&
737 m_request->method() != HTTPNames::HEAD) { 735 m_request->method() != HTTPNames::HEAD) {
738 if (m_request->buffer()) 736 if (m_request->buffer())
739 request.setHTTPBody(m_request->buffer()->drainAsFormData()); 737 request.setHTTPBody(m_request->buffer()->drainAsFormData());
740 if (m_request->attachedCredential()) 738 if (m_request->attachedCredential())
741 request.setAttachedCredential(m_request->attachedCredential()); 739 request.setAttachedCredential(m_request->attachedCredential());
742 } 740 }
743 request.setFetchRedirectMode(m_request->redirect()); 741 request.setFetchRedirectMode(m_request->redirect());
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 m_loaders.erase(loader); 930 m_loaders.erase(loader);
933 loader->dispose(); 931 loader->dispose();
934 } 932 }
935 933
936 DEFINE_TRACE(FetchManager) { 934 DEFINE_TRACE(FetchManager) {
937 visitor->trace(m_loaders); 935 visitor->trace(m_loaders);
938 ContextLifecycleObserver::trace(visitor); 936 ContextLifecycleObserver::trace(visitor);
939 } 937 }
940 938
941 } // namespace blink 939 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698