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

Side by Side Diff: Source/modules/serviceworkers/FetchHeaderList.cpp

Issue 399543002: [ServiceWorker] Make fetch() method better conformance with the spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated falken's comment Created 6 years, 5 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 "config.h" 5 #include "config.h"
6 #include "FetchHeaderList.h" 6 #include "FetchHeaderList.h"
7 7
8 #include "core/fetch/CrossOriginAccessControl.h" 8 #include "core/fetch/CrossOriginAccessControl.h"
9 #include "core/xml/XMLHttpRequest.h" 9 #include "core/xml/XMLHttpRequest.h"
10 #include "platform/network/HTTPParsers.h" 10 #include "platform/network/HTTPParsers.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 return true; 114 return true;
115 } 115 }
116 return false; 116 return false;
117 } 117 }
118 118
119 void FetchHeaderList::clearList() 119 void FetchHeaderList::clearList()
120 { 120 {
121 m_headerList.clear(); 121 m_headerList.clear();
122 } 122 }
123 123
124 bool FetchHeaderList::containsNonSimpleHeader() const
125 {
126 for (size_t i = 0; i < m_headerList.size(); ++i) {
127 if (!isSimpleHeader(m_headerList[i]->first, m_headerList[i]->second))
128 return true;
129 }
130 return false;
131 }
132
124 bool FetchHeaderList::isValidHeaderName(const String& name) 133 bool FetchHeaderList::isValidHeaderName(const String& name)
125 { 134 {
126 // "A name is a case-insensitive byte sequence that matches the field-name 135 // "A name is a case-insensitive byte sequence that matches the field-name
127 // token production." 136 // token production."
128 return isValidHTTPToken(name); 137 return isValidHTTPToken(name);
129 } 138 }
130 139
131 bool FetchHeaderList::isValidHeaderValue(const String& value) 140 bool FetchHeaderList::isValidHeaderValue(const String& value)
132 { 141 {
133 // "A value is a byte sequence that matches the field-value token production 142 // "A value is a byte sequence that matches the field-value token production
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 180 }
172 181
173 bool FetchHeaderList::isForbiddenResponseHeaderName(const String& name) 182 bool FetchHeaderList::isForbiddenResponseHeaderName(const String& name)
174 { 183 {
175 // "A forbidden response header name is a header name that is one of: 184 // "A forbidden response header name is a header name that is one of:
176 // `Set-Cookie`, `Set-Cookie2`" 185 // `Set-Cookie`, `Set-Cookie2`"
177 return equalIgnoringCase(name, "set-cookie") || equalIgnoringCase(name, "set -cookie2"); 186 return equalIgnoringCase(name, "set-cookie") || equalIgnoringCase(name, "set -cookie2");
178 } 187 }
179 188
180 } // namespace blink 189 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/FetchHeaderList.h ('k') | Source/modules/serviceworkers/FetchManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698