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

Unified Diff: third_party/WebKit/Source/modules/cachestorage/Cache.cpp

Issue 2787003002: Fetch API: Stop lowercasing header names. (Closed)
Patch Set: Rebase for landing 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/cachestorage/Cache.cpp
diff --git a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
index 174bd4d0684106d2a7583054faffab56eaeda3d3..bf116ee56a605103d1c0f706b9f2fe1661d84e4e 100644
--- a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
+++ b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
@@ -205,16 +205,13 @@ void RecordResponseTypeForAdd(const Member<Response>& response) {
bool VaryHeaderContainsAsterisk(const Response* response) {
const FetchHeaderList* headers = response->headers()->HeaderList();
- for (size_t i = 0; i < headers->size(); ++i) {
- const FetchHeaderList::Header& header = headers->Entry(i);
- if (header.first == "vary") {
- Vector<String> fields;
- header.second.Split(',', fields);
- for (size_t j = 0; j < fields.size(); ++j) {
- if (fields[j].StripWhiteSpace() == "*")
- return true;
- }
- }
+ String varyHeader;
+ if (headers->Get("vary", varyHeader)) {
+ Vector<String> fields;
+ varyHeader.Split(',', fields);
+ return std::any_of(fields.begin(), fields.end(), [](const String& field) {
+ return field.StripWhiteSpace() == "*";
+ });
}
return false;
}
« no previous file with comments | « third_party/WebKit/Source/modules/BUILD.gn ('k') | third_party/WebKit/Source/modules/fetch/FetchHeaderList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698