Index: third_party/WebKit/Source/platform/network/ParsedContentType.cpp |
diff --git a/third_party/WebKit/Source/platform/network/ParsedContentType.cpp b/third_party/WebKit/Source/platform/network/ParsedContentType.cpp |
index fb288e72b75104017e639190c2c67bc29534f4fc..8490b843d0a6742e7df0692e3888837996709706 100644 |
--- a/third_party/WebKit/Source/platform/network/ParsedContentType.cpp |
+++ b/third_party/WebKit/Source/platform/network/ParsedContentType.cpp |
@@ -264,11 +264,15 @@ bool ParsedContentType::parse(const String& contentType) { |
<< ", for '" << key.toString() << "')."; |
return false; |
} |
- String keyString = key.toString(); |
// As |key| is parsed as a token, it consists of ascii characters |
// and hence we don't need to care about non-ascii lowercasing. |
- DCHECK(keyString.containsOnlyASCII()); |
- map.set(keyString.lower(), value); |
+ DCHECK(key.toString().containsOnlyASCII()); |
+ String keyString = key.toString().lower(); |
+ if (m_mode == Mode::Strict && map.find(keyString) != map.end()) { |
+ DVLOG(1) << "Parameter " << keyString << " is defined multiple times."; |
+ return false; |
+ } |
+ map.set(keyString, value); |
} |
m_parameters = std::move(map); |
return true; |