Index: net/http/http_util.cc |
diff --git a/net/http/http_util.cc b/net/http/http_util.cc |
index 224ae6c4709eff000b3ac67bc5e18955dffce29c..4574c7fd25f661e4259ac9af7b507eec4fb0191b 100644 |
--- a/net/http/http_util.cc |
+++ b/net/http/http_util.cc |
@@ -340,6 +340,19 @@ bool HttpUtil::IsSafeHeader(const std::string& name) { |
} |
// static |
+bool HttpUtil::IsValidHeaderName(const std::string& name) { |
+ // Check whether the header name is RFC 2616-compliant. |
+ return HttpUtil::IsToken(name); |
+} |
+ |
+// static |
+bool HttpUtil::IsValidHeaderValue(const std::string& value) { |
+ // Just a sanity check: disallow NUL and CRLF. |
+ return value.find('\0') == std::string::npos && |
+ value.find("\r\n") == std::string::npos; |
+} |
+ |
+// static |
std::string HttpUtil::StripHeaders(const std::string& headers, |
const char* const headers_to_remove[], |
size_t headers_to_remove_len) { |