| 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 4db9ec146350df6f80b69e37a176eeb03afc6523..a54e0efa8cc70265a35782608b37397bbe3522c5 100644
|
| --- a/net/url_request/url_request_http_job.cc
|
| +++ b/net/url_request/url_request_http_job.cc
|
| @@ -55,6 +55,7 @@
|
| #include "net/proxy/proxy_info.h"
|
| #include "net/proxy/proxy_retry_info.h"
|
| #include "net/proxy/proxy_service.h"
|
| +#include "net/reporting/reporting_service.h"
|
| #include "net/ssl/channel_id_service.h"
|
| #include "net/ssl/ssl_cert_request_info.h"
|
| #include "net/ssl/ssl_config_service.h"
|
| @@ -362,6 +363,7 @@ void URLRequestHttpJob::NotifyHeadersComplete() {
|
| ProcessStrictTransportSecurityHeader();
|
| ProcessPublicKeyPinsHeader();
|
| ProcessExpectCTHeader();
|
| + ProcessReportToHeader();
|
|
|
| // Handle the server notification of a new SDCH dictionary.
|
| SdchManager* sdch_manager(request()->context()->sdch_manager());
|
| @@ -851,6 +853,28 @@ void URLRequestHttpJob::ProcessExpectCTHeader() {
|
| }
|
| }
|
|
|
| +void URLRequestHttpJob::ProcessReportToHeader() {
|
| + DCHECK(response_info_);
|
| +
|
| + ReportingService* service = request_->context()->reporting_service();
|
| + if (!service)
|
| + 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))
|
| + return;
|
| +
|
| + HttpResponseHeaders* headers = GetResponseHeaders();
|
| + std::string value;
|
| + if (!headers->GetNormalizedHeader("Report-To", &value))
|
| + return;
|
| +
|
| + service->ProcessHeader(request_info_.url.GetOrigin(), value);
|
| +}
|
| +
|
| void URLRequestHttpJob::OnStartCompleted(int result) {
|
| TRACE_EVENT0(kNetTracingCategory, "URLRequestHttpJob::OnStartCompleted");
|
| RecordTimer();
|
|
|