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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 500129: Merge 34751 - If we redirect from an https to an http site, ensure that we do... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 11 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
« no previous file with comments | « net/url_request/url_request.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
===================================================================
--- net/url_request/url_request_unittest.cc (revision 34934)
+++ net/url_request/url_request_unittest.cc (working copy)
@@ -241,6 +241,29 @@
}
}
+TEST_F(URLRequestTestHTTP, HTTPSToHTTPRedirectNoRefererTest) {
+ scoped_refptr<HTTPSTestServer> https_server =
+ HTTPSTestServer::CreateGoodServer(L"net/data/ssl/");
+ ASSERT_TRUE(NULL != https_server.get());
+ ASSERT_TRUE(NULL != server_.get());
+
+ // An https server is sent a request with an https referer,
+ // and responds with a redirect to an http url. The http
+ // server should not be sent the referer.
+ GURL http_destination = server_->TestServerPage("");
+ TestDelegate d;
+ TestURLRequest req(https_server->TestServerPage(
+ "server-redirect?" + http_destination.spec()), &d);
+ req.set_referrer("https://www.referrer.com/");
+ req.Start();
+ MessageLoop::current()->Run();
+
+ EXPECT_EQ(1, d.response_started_count());
+ EXPECT_EQ(1, d.received_redirect_count());
+ EXPECT_EQ(http_destination, req.url());
+ EXPECT_EQ(std::string(), req.referrer());
+}
+
TEST_F(URLRequestTest, QuitTest) {
// Don't use shared server here because we order it to quit.
// It would impact other tests.
« no previous file with comments | « net/url_request/url_request.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698