Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: net/url_request/url_request_unittest.cc

Issue 770343003: Block port 443 for all protocols other than HTTPS or WSS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add link to issue in comment next to port 443 on the (default) blocked list. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« net/base/net_util.cc ('K') | « net/http/http_stream_factory_impl_job.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 9892a692d1f1150229f602453dd2e03998697172..0233a358752231fdfb224491bc7447d2967a9990 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -5435,6 +5435,25 @@ TEST_F(URLRequestTestHTTP, NoCacheOnNetworkDelegateRedirect) {
}
}
+// Make sure an HTTP request using the "unsafe" port 443 fails.
+// See: https://crbug.com/436451
+TEST_F(URLRequestTestHTTP, UnsafePort) {
+ TestDelegate d;
+ {
+ scoped_ptr<URLRequest> r(default_context_.CreateRequest(
+ GURL("http://www.google.com:443/"), DEFAULT_PRIORITY, &d, NULL));
+
+ r->Start();
+ EXPECT_TRUE(r->is_pending());
+
+ base::RunLoop().Run();
+
+ EXPECT_FALSE(r->is_pending());
+ EXPECT_EQ(URLRequestStatus::FAILED, r->status().status());
+ EXPECT_EQ(ERR_UNSAFE_PORT, r->status().error());
+ }
+}
+
// Tests that redirection to an unsafe URL is allowed when it has been marked as
// safe.
TEST_F(URLRequestTestHTTP, UnsafeRedirectToWhitelistedUnsafeURL) {
« net/base/net_util.cc ('K') | « net/http/http_stream_factory_impl_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698