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 1a60ac4f52cb6e13fbc7bde9810114eba65787aa..890620a9d5bf1f3590b9d631ec8fa8179e174f5f 100644 |
--- a/net/url_request/url_request_http_job.cc |
+++ b/net/url_request/url_request_http_job.cc |
@@ -794,6 +794,10 @@ void URLRequestHttpJob::ProcessStrictTransportSecurityHeader() { |
!security_state) |
return; |
+ // Don't accept HSTS headers when the hostname is an IP address. |
+ if (request_info_.url.HostIsIPAddress()) |
+ return; |
+ |
// http://tools.ietf.org/html/draft-ietf-websec-strict-transport-sec: |
// |
// If a UA receives more than one STS header field in a HTTP response |
@@ -817,6 +821,10 @@ void URLRequestHttpJob::ProcessPublicKeyPinsHeader() { |
!security_state) |
return; |
+ // Don't accept HSTS headers when the hostname is an IP address. |
+ if (request_info_.url.HostIsIPAddress()) |
+ return; |
+ |
// http://tools.ietf.org/html/draft-ietf-websec-key-pinning: |
// |
// If a UA receives more than one PKP header field in an HTTP |