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

Side by Side Diff: third_party/WebKit/Source/core/fetch/FetchUtils.cpp

Issue 2254693002: Delay generation of User-Agent header to URLRequestHttpJob and accept custom User-Agent from XHR/Fe… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed Android test Created 4 years, 3 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 "core/fetch/FetchUtils.h" 5 #include "core/fetch/FetchUtils.h"
6 6
7 #include "platform/HTTPNames.h" 7 #include "platform/HTTPNames.h"
8 #include "platform/network/HTTPHeaderMap.h" 8 #include "platform/network/HTTPHeaderMap.h"
9 #include "platform/network/HTTPParsers.h" 9 #include "platform/network/HTTPParsers.h"
10 #include "wtf/HashSet.h" 10 #include "wtf/HashSet.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 "dnt", 58 "dnt",
59 "expect", 59 "expect",
60 "host", 60 "host",
61 "keep-alive", 61 "keep-alive",
62 "origin", 62 "origin",
63 "referer", 63 "referer",
64 "te", 64 "te",
65 "trailer", 65 "trailer",
66 "transfer-encoding", 66 "transfer-encoding",
67 "upgrade", 67 "upgrade",
68 "user-agent",
69 "via", 68 "via",
70 }; 69 };
71 } 70 }
72 71
73 const ForbiddenHeaderNames& ForbiddenHeaderNames::get() 72 const ForbiddenHeaderNames& ForbiddenHeaderNames::get()
74 { 73 {
75 DEFINE_THREAD_SAFE_STATIC_LOCAL(const ForbiddenHeaderNames, instance, new Fo rbiddenHeaderNames); 74 DEFINE_THREAD_SAFE_STATIC_LOCAL(const ForbiddenHeaderNames, instance, new Fo rbiddenHeaderNames);
76 return instance; 75 return instance;
77 } 76 }
78 77
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 String FetchUtils::normalizeHeaderValue(const String& value) 208 String FetchUtils::normalizeHeaderValue(const String& value)
210 { 209 {
211 // https://fetch.spec.whatwg.org/#concept-header-value-normalize 210 // https://fetch.spec.whatwg.org/#concept-header-value-normalize
212 // Strip leading and trailing whitespace from header value. 211 // Strip leading and trailing whitespace from header value.
213 // HTTP whitespace bytes are 0x09, 0x0A, 0x0D, and 0x20. 212 // HTTP whitespace bytes are 0x09, 0x0A, 0x0D, and 0x20.
214 213
215 return value.stripWhiteSpace(isHTTPWhitespace); 214 return value.stripWhiteSpace(isHTTPWhitespace);
216 } 215 }
217 216
218 } // namespace blink 217 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698