Backed out 2 changesets (bug 1243586) for dt5 bustage in netmonitor tests
authorWes Kocher <wkocher@mozilla.com>
Mon, 29 Feb 2016 10:39:04 -0800
changeset 324378 6866466b1d718cfe4d1305916336d8e133fc19b8
parent 324377 7566245cc5ea9e15415e71a2599ec72c953189df
child 324379 d686bf9e479fef8b98decc57b28a50dbf65321b9
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1243586
milestone47.0a1
backs out06a4d2d48fb2cdb90d93a942808eae19190d5d60
846e31fe5eb27639054fe70967844edbbe6d6be4
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
Backed out 2 changesets (bug 1243586) for dt5 bustage in netmonitor tests Backed out changeset 06a4d2d48fb2 (bug 1243586) Backed out changeset 846e31fe5eb2 (bug 1243586) MozReview-Commit-ID: 69kiDIULtm2
dom/security/test/unit/test_csp_upgrade_insecure_request_header.js
dom/security/test/unit/xpcshell.ini
netwerk/protocol/http/nsHttpChannel.cpp
deleted file mode 100644
--- a/dom/security/test/unit/test_csp_upgrade_insecure_request_header.js
+++ /dev/null
@@ -1,98 +0,0 @@
-var Cu = Components.utils;
-var Ci = Components.interfaces;
-
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "URL", function() {
-  return "http://localhost:" + httpserver.identity.primaryPort;
-});
-
-var httpserver =  null;
-var channel = null;
-var curTest = null;
-var testpath = "/footpath";
-
-var tests = [
-  {
-    description: "should not set request header for TYPE_OTHER",
-    expectingHeader: false,
-    contentType: Ci.nsIContentPolicy.TYPE_OTHER
-  },
-  {
-    description: "should set request header for TYPE_DOCUMENT",
-    expectingHeader: true,
-    contentType: Ci.nsIContentPolicy.TYPE_DOCUMENT
-  },
-  {
-    description: "should set request header for TYPE_SUBDOCUMENT",
-    expectingHeader: true,
-    contentType: Ci.nsIContentPolicy.TYPE_SUBDOCUMENT
-  },
-  {
-    description: "should not set request header for TYPE_IMG",
-    expectingHeader: false,
-    contentType: Ci.nsIContentPolicy.TYPE_IMG
-  },
-];
-
-function ChannelListener() {
-}
-
-ChannelListener.prototype = {
-  onStartRequest: function(request, context) { },
-  onDataAvailable: function(request, context, stream, offset, count) {
-    do_throw("Should not get any data!");
-  },
-  onStopRequest: function(request, context, status) {
-    var upgrade_insecure_header = false;
-    try {
-      if (request.getRequestHeader("Upgrade-Insecure-Requests")) {
-        upgrade_insecure_header = true;
-      }
-    }
-    catch (e) {
-      // exception is thrown if header is not available on the request
-    }
-    // debug
-    // dump("executing test: " + curTest.description);
-    do_check_eq(upgrade_insecure_header, curTest.expectingHeader)
-    run_next_test();
-  },
-};
-
-function setupChannel(aContentType) {
-  var chan = NetUtil.newChannel({
-    uri: URL + testpath,
-    loadUsingSystemPrincipal: true,
-    contentPolicyType: aContentType
-  });
-  chan.QueryInterface(Ci.nsIHttpChannel);
-  chan.requestMethod = "GET";
-  return chan;
-}
-
-function serverHandler(metadata, response) {
-  // no need to perform anything here
-}
-
-function run_next_test() {
-  curTest = tests.shift();
-  if (!curTest) {
-    httpserver.stop(do_test_finished);
-    return;
-  }
-  channel = setupChannel(curTest.contentType);
-  channel.asyncOpen(new ChannelListener(), null);
-}
-
-function run_test() {
-  // set up the test environment
-  httpserver = new HttpServer();
-  httpserver.registerPathHandler(testpath, serverHandler);
-  httpserver.start(-1);
-
-  run_next_test();
-  do_test_pending();
-}
--- a/dom/security/test/unit/xpcshell.ini
+++ b/dom/security/test/unit/xpcshell.ini
@@ -1,9 +1,8 @@
 [DEFAULT]
 head =
 tail =
 skip-if = toolkit == 'gonk'
 
 [test_csp_reports.js]
 skip-if = buildapp == 'mulet'
 [test_isURIPotentiallyTrustworthy.js]
-[test_csp_upgrade_insecure_request_header.js]
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -310,31 +310,16 @@ nsHttpChannel::AddSecurityMessage(const 
 
 nsresult
 nsHttpChannel::Connect()
 {
     nsresult rv;
 
     LOG(("nsHttpChannel::Connect [this=%p]\n", this));
 
-    // Note that we are only setting the "Upgrade-Insecure-Requests" request
-    // header for *all* navigational requests instead of all requests as
-    // defined in the spec, see:
-    // https://www.w3.org/TR/upgrade-insecure-requests/#preference
-    nsContentPolicyType type = mLoadInfo ?
-                               mLoadInfo->GetExternalContentPolicyType() :
-                               nsIContentPolicy::TYPE_OTHER;
-
-    if (type == nsIContentPolicy::TYPE_DOCUMENT ||
-        type == nsIContentPolicy::TYPE_SUBDOCUMENT) {
-        rv = SetRequestHeader(NS_LITERAL_CSTRING("Upgrade-Insecure-Requests"),
-                              NS_LITERAL_CSTRING("1"), false);
-        NS_ENSURE_SUCCESS(rv, rv);
-    }
- 
     bool isHttps = false;
     rv = mURI->SchemeIs("https", &isHttps);
     NS_ENSURE_SUCCESS(rv,rv);
     nsCOMPtr<nsIPrincipal> resultPrincipal;
     if (!isHttps && mLoadInfo) {
         nsContentUtils::GetSecurityManager()->
           GetChannelResultPrincipal(this, getter_AddRefs(resultPrincipal));
     }