summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-12-09 10:12:45 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-12-09 10:12:45 -0800
commit17bf5aa971cfe6f192f7da40988cc98fb14f6d2e (patch)
tree71859b6a42e4184c1262fd9ccdbdfd4c01a19e4f
parent89086adea4e79a9200a1cdc230a0e9d67925142a (diff)
parentf3cc3c8581afce262b099794508129d16120adc0 (diff)
downloadexternal_webkit-17bf5aa971cfe6f192f7da40988cc98fb14f6d2e.zip
external_webkit-17bf5aa971cfe6f192f7da40988cc98fb14f6d2e.tar.gz
external_webkit-17bf5aa971cfe6f192f7da40988cc98fb14f6d2e.tar.bz2
Merge "WebResponse headers should be case-insensitive."
-rw-r--r--WebKit/android/WebCoreSupport/WebResponse.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/WebKit/android/WebCoreSupport/WebResponse.h b/WebKit/android/WebCoreSupport/WebResponse.h
index 84a93ab..f03e4bb 100644
--- a/WebKit/android/WebCoreSupport/WebResponse.h
+++ b/WebKit/android/WebCoreSupport/WebResponse.h
@@ -71,7 +71,15 @@ private:
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);
};