Bug 1211871 - Backout bug 1142083 r=mcmanus, a=sylvestre
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 12 Oct 2015 23:49:23 +0200
changeset 289581 32de6f21dd48
parent 289580 2bfd512a01af
child 289582 f585fae6c50a
push id5199
push usercbook@mozilla.com
push date2015-10-19 15:09 +0000
treeherdermozilla-beta@32de6f21dd48 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, sylvestre
bugs1211871, 1142083
milestone42.0
Bug 1211871 - Backout bug 1142083 r=mcmanus, a=sylvestre
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/test/mochitests/empty.html
netwerk/test/mochitests/mochitest.ini
netwerk/test/mochitests/redirect_idn.html
netwerk/test/mochitests/redirect_idn.html^headers^
netwerk/test/mochitests/test_idn_redirect.html
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -4593,32 +4593,16 @@ nsHttpChannel::AsyncProcessRedirection(u
 
     nsresult rv = CreateNewURI(location, getter_AddRefs(mRedirectURI));
 
     if (NS_FAILED(rv)) {
         LOG(("Invalid URI for redirect: Location: %s\n", location));
         return NS_ERROR_CORRUPTED_CONTENT;
     }
 
-    nsAutoCString redirectHost;
-    mRedirectURI->GetHost(redirectHost);
-    nsAutoCString currentHost;
-    mURI->GetHost(currentHost);
-    if (redirectHost != currentHost) {
-        // When redirecting to another domain, the target domain should not be
-        // percent encoded, as the URL parser does not yet support that
-        nsAutoCString unescapedHost;
-        if (NS_UnescapeURL(redirectHost.BeginReading(), redirectHost.Length(),
-                           0, unescapedHost)) {
-            if (IsUTF8(unescapedHost)) {
-                mRedirectURI->SetHost(unescapedHost);
-            }
-        }
-    }
-
     if (mApplicationCache) {
         // if we are redirected to a different origin check if there is a fallback
         // cache entry to fall back to. we don't care about file strict
         // checking, at least mURI is not a file URI.
         if (!NS_SecurityCompareURIs(mURI, mRedirectURI, false)) {
             PushRedirectAsyncFunc(&nsHttpChannel::ContinueProcessRedirectionAfterFallback);
             bool waitingForRedirectCallback;
             (void)ProcessFallback(&waitingForRedirectCallback);
deleted file mode 100644
--- a/netwerk/test/mochitests/empty.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-  This page does nothing. If the loading page managed to load this, the test
-  probably succeeded.
-</body>
-</html>
--- a/netwerk/test/mochitests/mochitest.ini
+++ b/netwerk/test/mochitests/mochitest.ini
@@ -2,25 +2,21 @@
 skip-if = buildapp == 'b2g' || toolkit == 'android' # Android: Bug 1111137 & 1078267
 
 support-files =
   method.sjs
   partial_content.sjs
   rel_preconnect.sjs
   user_agent.sjs
   user_agent_update.sjs
-  redirect_idn.html^headers^
-  redirect_idn.html
-  empty.html
 
 [test_arraybufferinputstream.html]
 [test_partially_cached_content.html]
 [test_rel_preconnect.html]
 skip-if = e10s
 [test_uri_scheme.html]
 [test_user_agent_overrides.html]
 skip-if = e10s
 [test_user_agent_updates.html]
 skip-if = e10s
 [test_user_agent_updates_reset.html]
 [test_xhr_method_case.html]
 skip-if = e10s
-[test_idn_redirect.html]
deleted file mode 100644
deleted file mode 100644
--- a/netwerk/test/mochitests/redirect_idn.html^headers^
+++ /dev/null
@@ -1,3 +0,0 @@
-HTTP 301 Moved Permanently
-Location: http://exämple.test/tests/netwerk/test/mochitests/empty.html
-X-Comment: Bug 1142083 - This is a redirect to http://exämple.test
deleted file mode 100644
--- a/netwerk/test/mochitests/test_idn_redirect.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-  Bug 1142083 - IDN Unicode domain redirect is broken
-  This test loads redirectme.html which is redirected simple_test.html, on a different IDN domain.
-  A message is posted to that page, with responds with another.
-  Upon receiving that message, we consider that the IDN redirect has functioned properly, since the intended page was loaded.
--->
-<head>
-  <title>Test for URI Manipulation</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-
-<pre id="test">
-<script type="text/javascript">
-
-SimpleTest.waitForExplicitFinish();
-
-var iframe = document.createElement("iframe");
-iframe.src = "about:blank";
-iframe.addEventListener("load", finishTest);
-document.body.appendChild(iframe);
-iframe.src = "http://mochi.test:8888/tests/netwerk/test/mochitests/redirect_idn.html";
-
-function finishTest(e) {
-  ok(true);
-  SimpleTest.finish();
-}
-
-</script>
-
-</body>
-</html>
-