The CTS test WebViewTest.testSetDownloadListener was failing due to
a disagreement over the capitalization of "Content-Disposition". Rather
than making our stack exactly match the CTS server, it looks like the
headers should actually be case-insensitive. (Note that we still preserve
the case of the headers exactly as reported by the server, so hopefully
this won't break anything else.)
BUG=
3242063
TEST=WebViewTest.testSetDownloadListener
Change-Id: I0931da98aab9080127e355e51d89ac3fde12e7c2
std::string m_mime;
std::string m_url;
- std::map<std::string, std::string> m_headerFields;
+ struct CaseInsensitiveLessThan {
+ bool operator()(const std::string& lhs, const std::string& rhs) const {
+ return strcasecmp(lhs.c_str(), rhs.c_str()) < 0;
+ }
+ };
+
+ // Header fields are case insensitive, so we use a case-insensitive map.
+ // See RFC 822, 3.4.7, "CASE INDEPENDENCE".
+ std::map<std::string, std::string, CaseInsensitiveLessThan> m_headerFields;
void setMimeType(const std::string &mimeType);
};