Index: net/ocsp/nss_ocsp.cc |
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc |
index 7618f9e70959f2d409027bfebb1dcbacb6cfe9c7..7db2fb5aa1d4bfe0cb60d9e1a88e2e38a34b7b3e 100644 |
--- a/net/ocsp/nss_ocsp.cc |
+++ b/net/ocsp/nss_ocsp.cc |
@@ -248,6 +248,19 @@ class OCSPRequestSession |
return data_; |
} |
+ virtual void OnReceivedRedirect(URLRequest* request, |
+ const GURL& new_url, |
+ bool* defer_redirect) { |
+ DCHECK_EQ(request, request_); |
+ DCHECK_EQ(MessageLoopForIO::current(), io_loop_); |
+ |
+ if (!new_url.SchemeIs("http")) { |
+ // Prevent redirects to non-HTTP schemes, including HTTPS. This matches |
+ // the initial check in OCSPServerSession::CreateRequest(). |
+ CancelURLRequest(); |
+ } |
+ } |
+ |
virtual void OnResponseStarted(URLRequest* request) { |
DCHECK_EQ(request, request_); |
DCHECK_EQ(MessageLoopForIO::current(), io_loop_); |