summaryrefslogtreecommitdiffstats
path: root/net/http/http_util.h
diff options
context:
space:
mode:
authorhiroshige <hiroshige@chromium.org>2015-12-21 23:50:25 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-22 07:51:16 +0000
commitcb76caa4c5d065991a03c54f80e3e6ae239d7a59 (patch)
treef48990626c949b06d02d68c562fbbcff07d3384c /net/http/http_util.h
parentf4472f271bdfe98865cedc20a28466ac9fbfb09c (diff)
downloadchromium_src-cb76caa4c5d065991a03c54f80e3e6ae239d7a59.zip
chromium_src-cb76caa4c5d065991a03c54f80e3e6ae239d7a59.tar.gz
chromium_src-cb76caa4c5d065991a03c54f80e3e6ae239d7a59.tar.bz2
Add UMAs for checking header values against RFC 7230 in //net
This CL inserts UMAs to URLRequestHttpJob to count the number of requests/responses that contains invalid header values in RFC 7230. This is the first step to investigate the feasibility of updating header value check to RFC 7230 in //net stack. BUG=455099 Review URL: https://codereview.chromium.org/1374883002 Cr-Commit-Position: refs/heads/master@{#366563}
Diffstat (limited to 'net/http/http_util.h')
-rw-r--r--net/http/http_util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/http/http_util.h b/net/http/http_util.h
index 21a1f42..13209b8 100644
--- a/net/http/http_util.h
+++ b/net/http/http_util.h
@@ -82,6 +82,11 @@ class NET_EXPORT HttpUtil {
// a fully RFC-2616-compliant header value validation.
static bool IsValidHeaderValue(const std::string& value);
+ // Returns true if |value| is a valid HTTP header value according to
+ // RFC 7230 and doesn't contain CR or LF.
+ // i.e. returns true if |value| matches |*field-content| in RFC 7230.
+ static bool IsValidHeaderValueRFC7230(const base::StringPiece& 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|.