Index: third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp |
diff --git a/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp b/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp |
index ca24581c50d6d8947f534060708b79cfea3f77c1..f87594ea0788b4b073305d3064392366d00ce2f0 100644 |
--- a/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp |
+++ b/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp |
@@ -87,13 +87,20 @@ void FetchHeaderList::remove(const String& name) { |
bool FetchHeaderList::get(const String& name, String& result) const { |
const String lowercasedName = name.lower(); |
- for (size_t i = 0; i < m_headerList.size(); ++i) { |
- if (m_headerList[i]->first == lowercasedName) { |
- result = m_headerList[i]->second; |
- return true; |
+ bool found = false; |
+ for (const auto& header : m_headerList) { |
+ if (header->first == lowercasedName) { |
+ if (!found) { |
+ result = ""; |
+ result.append(header->second); |
+ found = true; |
+ } else { |
+ result.append(","); |
+ result.append(header->second); |
+ } |
} |
} |
- return false; |
+ return found; |
} |
void FetchHeaderList::getAll(const String& name, Vector<String>& result) const { |