Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Unified Diff: net/http/http_util.h

Issue 491123004: Make sure that HttpRequestHeaders contains valid key-value pairs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: edit comment Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_request_headers.cc ('k') | net/http/http_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util.h
diff --git a/net/http/http_util.h b/net/http/http_util.h
index 14117c00289d22bd54c28398c28fdb99eb72a59f..bde65dc797b14791a1911494bb4b8a18852c2667 100644
--- a/net/http/http_util.h
+++ b/net/http/http_util.h
@@ -75,6 +75,13 @@ class NET_EXPORT HttpUtil {
// named |name|.
static bool IsSafeHeader(const std::string& name);
+ // Returns true if |name| is a valid HTTP header name.
+ static bool IsValidHeaderName(const std::string& name);
+
+ // Returns false if |value| contains NUL or CRLF. This method does not perform
+ // a fully RFC-2616-compliant header value validation.
+ static bool IsValidHeaderValue(const std::string& value);
+
// Strips all header lines from |headers| whose name matches
// |headers_to_remove|. |headers_to_remove| is a list of null-terminated
// lower-case header names, with array length |headers_to_remove_len|.
« no previous file with comments | « net/http/http_request_headers.cc ('k') | net/http/http_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698