Bug 1211871 - Backout bug 1142083. r=mcmanus
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 12 Oct 2015 23:49:23 +0200
changeset 267378 4c9040d0d4d3707b1873dd493952d4c17625b66e
parent 267377 b71f15364923d3d7b424b6a8f65a6f3051eae424
child 267379 fab77933a2c79c0251986081d756246e7bb34d35
push id66457
push usercbook@mozilla.com
push dateTue, 13 Oct 2015 07:06:32 +0000
treeherdermozilla-inbound@fab77933a2c7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1211871, 1142083
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1211871 - Backout bug 1142083. r=mcmanus
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
@@ -4604,32 +4604,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,30 +2,26 @@
 skip-if = buildapp == 'b2g'
 
 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
   web_packaged_app.sjs
   signed_web_packaged_app.sjs
 
 [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]
 [test_signed_web_packaged_app.html]
 skip-if = e10s || buildapp != 'browser'
 [test_web_packaged_app.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>
-