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

Unified Diff: Source/modules/serviceworkers/FetchHeaderList.cpp

Issue 329853012: [ServiceWorker] Make Request class better conformance with the spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/serviceworkers/FetchHeaderList.cpp
diff --git a/Source/modules/serviceworkers/FetchHeaderList.cpp b/Source/modules/serviceworkers/FetchHeaderList.cpp
index ec5702314a7a46d484756affbbcaa14f86009d67..a0e0389e97fa7042521f44aa740185c0e92e7b29 100644
--- a/Source/modules/serviceworkers/FetchHeaderList.cpp
+++ b/Source/modules/serviceworkers/FetchHeaderList.cpp
@@ -17,6 +17,15 @@ PassRefPtr<FetchHeaderList> FetchHeaderList::create()
return adoptRef(new FetchHeaderList());
}
+PassRefPtr<FetchHeaderList> FetchHeaderList::createCopy()
+{
+ RefPtr<FetchHeaderList> list(create());
+ for (size_t i = 0; i < m_headerList.size(); ++i) {
+ list->append(m_headerList[i]->first, m_headerList[i]->second);
+ }
+ return list.release();
+}
+
FetchHeaderList::FetchHeaderList()
{
}
@@ -151,7 +160,7 @@ bool FetchHeaderList::isForbiddenHeaderName(const String& name)
// `Transfer-Encoding`, `Upgrade`, `User-Agent`, `Via`
// or starts with `Proxy-` or `Sec-` (including when it is just `Proxy-` or
// `Sec-`)."
- return !XMLHttpRequest::isAllowedHTTPHeader(name);
+ return !XMLHttpRequest::isAllowedHTTPHeader(name) || equalIgnoringCase(name, "DNT");
}
bool FetchHeaderList::isForbiddenResponseHeaderName(const String& name)

Powered by Google App Engine
This is Rietveld 408576698