Index: net/url_request/url_request_http_job.cc |
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc |
index 929d19467a6b5bb4ec4fb19aedcb4f0a77a355a0..3ad92fcbec0de886ac30c1902353035ccbc8e146 100644 |
--- a/net/url_request/url_request_http_job.cc |
+++ b/net/url_request/url_request_http_job.cc |
@@ -483,6 +483,15 @@ void URLRequestHttpJob::StartTransactionInternal() { |
// If we already have a transaction, then we should restart the transaction |
// with auth provided by auth_credentials_. |
+ int invalid_header_values_in_RFC7230 = 0; |
davidben
2015/12/15 21:16:36
This should probably be a bool (and then you can b
hiroshige
2015/12/17 06:36:02
Done.
|
+ for (net::HttpRequestHeaders::Iterator it(request_info_.extra_headers); |
davidben
2015/12/15 21:16:36
Nit: No net:: prefix.
hiroshige
2015/12/17 06:36:02
Done.
|
+ it.GetNext();) { |
+ if (!HttpUtil::IsValidHeaderValueRFC7230(it.value())) |
+ ++invalid_header_values_in_RFC7230; |
+ } |
+ UMA_HISTOGRAM_BOOLEAN("Net.HttpRequestContainsInvalidHeaderValuesInRFC7230", |
+ invalid_header_values_in_RFC7230 > 0); |
+ |
int rv; |
if (network_delegate()) { |
@@ -925,6 +934,20 @@ void URLRequestHttpJob::OnStartCompleted(int result) { |
// Clear the IO_PENDING status |
SetStatus(URLRequestStatus()); |
+ if (scoped_refptr<HttpResponseHeaders> headers = GetResponseHeaders()) { |
davidben
2015/12/15 21:16:36
I don't think we usually declare variables inside
hiroshige
2015/12/17 06:36:02
Done. Also I moved this to exclude error cases.
|
+ void* iter = NULL; |
+ std::string name; |
+ std::string value; |
+ int invalid_header_values_in_RFC7230 = 0; |
davidben
2015/12/15 21:16:36
Ditto about making this a bool.
hiroshige
2015/12/17 06:36:02
Done.
|
+ while (headers->EnumerateHeaderLines(&iter, &name, &value)) { |
+ if (!HttpUtil::IsValidHeaderValueRFC7230(value)) |
+ ++invalid_header_values_in_RFC7230; |
+ } |
+ UMA_HISTOGRAM_BOOLEAN( |
+ "Net.HttpResponseContainsInvalidHeaderValuesInRFC7230", |
+ invalid_header_values_in_RFC7230 > 0); |
+ } |
+ |
const URLRequestContext* context = request_->context(); |
if (result == OK) { |