| 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 fa2833368cf19bd86a92c0a52e1550919c0cafd7..32dd01f57b14832477bba1bb4978a98b8b12e6cf 100644
|
| --- a/net/url_request/url_request_http_job.cc
|
| +++ b/net/url_request/url_request_http_job.cc
|
| @@ -75,6 +75,7 @@
|
| #endif
|
|
|
| #if BUILDFLAG(ENABLE_REPORTING)
|
| +#include "net/reporting/reporting_header_parser.h"
|
| #include "net/reporting/reporting_service.h"
|
| #endif // BUILDFLAG(ENABLE_REPORTING)
|
|
|
| @@ -858,21 +859,29 @@ void URLRequestHttpJob::ProcessReportToHeader() {
|
| DCHECK(response_info_);
|
|
|
| #if BUILDFLAG(ENABLE_REPORTING)
|
| + HttpResponseHeaders* headers = GetResponseHeaders();
|
| + std::string value;
|
| + if (!headers->GetNormalizedHeader("Report-To", &value))
|
| + return;
|
| +
|
| ReportingService* service = request_->context()->reporting_service();
|
| - if (!service)
|
| + if (!service) {
|
| + ReportingHeaderParser::RecordHeaderDiscardedForNoReportingService();
|
| return;
|
| + }
|
|
|
| // Only accept Report-To headers on HTTPS connections that have no
|
| // certificate errors.
|
| // TODO(juliatuttle): Do we need to check cert status?
|
| const SSLInfo& ssl_info = response_info_->ssl_info;
|
| - if (!ssl_info.is_valid() || IsCertStatusError(ssl_info.cert_status))
|
| + if (!ssl_info.is_valid()) {
|
| + ReportingHeaderParser::RecordHeaderDiscardedForInvalidSSLInfo();
|
| return;
|
| -
|
| - HttpResponseHeaders* headers = GetResponseHeaders();
|
| - std::string value;
|
| - if (!headers->GetNormalizedHeader("Report-To", &value))
|
| + }
|
| + if (IsCertStatusError(ssl_info.cert_status)) {
|
| + ReportingHeaderParser::RecordHeaderDiscardedForCertStatusError();
|
| return;
|
| + }
|
|
|
| service->ProcessHeader(request_info_.url.GetOrigin(), value);
|
| #endif // BUILDFLAG(ENABLE_REPORTING)
|
|
|