bug 1503393 - never let "localhost" get sent to a proxy r=mayhemer
☠☠ backed out by 7670b6ce33a4 ☠ ☠
authorDaniel Stenberg <daniel@haxx.se>
Mon, 03 Dec 2018 16:27:11 +0200
changeset 508454 49428012434e379316f2d831a088a27cf1b429ee
parent 508453 f349e5a7d515306dcfa5d0b9eb62f676873e8e78
child 508455 02e383b73c971e656097b3040e9cc523039018d6
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1503393
milestone65.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 1503393 - never let "localhost" get sent to a proxy r=mayhemer
netwerk/base/nsProtocolProxyService.cpp
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -2027,16 +2027,22 @@ nsresult nsProtocolProxyService::Resolve
   nsresult rv = GetProxyURI(channel, getter_AddRefs(uri));
   if (NS_FAILED(rv)) return rv;
 
   // See bug #586908.
   // Avoid endless loop if |uri| is the current PAC-URI. Returning OK
   // here means that we will not use a proxy for this connection.
   if (mPACMan && mPACMan->IsPACURI(uri)) return NS_OK;
 
+  // if proxies are enabled and this host:port combo is supposed to use a
+  // proxy, check for a proxy.
+  if ((mProxyConfig == PROXYCONFIG_DIRECT) ||
+      !CanUseProxy(uri, info.defaultPort))
+    return NS_OK;
+
   bool mainThreadOnly;
   if (mSystemProxySettings && mProxyConfig == PROXYCONFIG_SYSTEM &&
       NS_SUCCEEDED(mSystemProxySettings->GetMainThreadOnly(&mainThreadOnly)) &&
       !mainThreadOnly) {
     *usePACThread = true;
     return NS_OK;
   }