Bug 1549368 - Let proxyAuthorizationHeader and connectionIsolationKey in proxy.onRequest apply only to HTTPS proxies, no test, r=dragana
authorHonza Bambas <honzab.moz@firemni.cz>
Mon, 06 May 2019 16:28:25 +0000
changeset 472769 55198bafdb8734d14c2174c9ad1a1e0b7116f854
parent 472768 1f47ae47ceacd9bb1df12c3dd8987b93bd44f608
child 472770 a40ff03e71e3c80c2305bb13dc575faa153ddaae
push id35978
push usershindli@mozilla.com
push dateTue, 07 May 2019 09:44:39 +0000
treeherdermozilla-central@7aee5a30dd15 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdragana
bugs1549368
milestone68.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 1549368 - Let proxyAuthorizationHeader and connectionIsolationKey in proxy.onRequest apply only to HTTPS proxies, no test, r=dragana Differential Revision: https://phabricator.services.mozilla.com/D30066
netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
netwerk/test/unit/xpcshell.ini
--- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
+++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
@@ -1544,21 +1544,25 @@ void nsHttpChannelAuthProvider::SetAutho
   // or a webserver
   nsISupports** continuationState;
 
   nsAutoCString suffix;
   if (header == nsHttp::Proxy_Authorization) {
     continuationState = &mProxyAuthContinuationState;
 
     if (mProxyInfo) {
-      // Let this be overriden by anything from the cache.
-      auto const& pa = mProxyInfo->ProxyAuthorizationHeader();
-      if (!pa.IsEmpty()) {
-        rv = mAuthChannel->SetProxyCredentials(pa);
-        MOZ_ASSERT(NS_SUCCEEDED(rv));
+      nsAutoCString type;
+      mProxyInfo->GetType(type);
+      if (type.EqualsLiteral("https")) {
+        // Let this be overriden by anything from the cache.
+        auto const& pa = mProxyInfo->ProxyAuthorizationHeader();
+        if (!pa.IsEmpty()) {
+          rv = mAuthChannel->SetProxyCredentials(pa);
+          MOZ_ASSERT(NS_SUCCEEDED(rv));
+        }
       }
     }
   } else {
     continuationState = &mAuthContinuationState;
 
     nsCOMPtr<nsIChannel> chan = do_QueryInterface(mAuthChannel);
     GetOriginAttributesSuffix(chan, suffix);
   }
--- a/netwerk/test/unit/xpcshell.ini
+++ b/netwerk/test/unit/xpcshell.ini
@@ -447,8 +447,10 @@ skip-if = os == "android"
 skip-if = os == "android" # DNSv6 issues on android
 [test_suspend_channel_on_authRetry.js]
 [test_suspend_channel_on_examine_merged_response.js]
 [test_bug1527293.js]
 [test_stale-while-revalidate_negative.js]
 [test_stale-while-revalidate_positive.js]
 [test_stale-while-revalidate_max-age-0.js]
 [test_proxy-authorization-via-proxyinfo.js]
+# Bug 1549368
+skip-if = true