'No Proxy For' does not work right if it contains '<local>' only

RESOLVED FIXED in Firefox 58

Status

()

defect
P2
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: me, Assigned: valentin.gosu)

Tracking

57 Branch
mozilla58
Points:
---

Firefox Tracking Flags

(firefox58 fixed)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 attachment)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Steps to reproduce:

In configuration, set the 'No Proxy For' as '<local>', then access http://example/


Actual results:

It's accessed via the proxy server.


Expected results:

It should be accessed directly.
If the 'No Proxy For' is set as '<local>, anything', http://example/ is accessed directly.

In netwerk/base/nsProtocolProxyService.cpp nsProtocolProxyService::CanUseProxy, there is a filter length check:

if (mHostFiltersArray.Length() == 0)
    return true;

and a plain hostname check:

// Don't use proxy for local hosts (plain hostname, no dots)
if ((!is_ipaddr && mFilterLocalHosts && !host.Contains('.')) ||
    host.EqualsLiteral("127.0.0.1") ||
    host.EqualsLiteral("::1")) {
    LOG(("Not using proxy for this local host [%s]!\n", host.get()));
    return false; // don't allow proxying
}

I think the plain hostname check should be done before the filter length check.
Component: Untriaged → Networking
Product: Firefox → Core
Assignee: nobody → valentin.gosu
Priority: -- → P2
Whiteboard: [necko-triaged]
Comment on attachment 8919739 [details]
Bug 1403522 - 'No Proxy For' does not work right if it contains '<local>' only

https://reviewboard.mozilla.org/r/190680/#review197196
Attachment #8919739 - Flags: review?(daniel) → review+
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/4f5c0b1eff85
'No Proxy For' does not work right if it contains '<local>' only r=bagder
https://hg.mozilla.org/mozilla-central/rev/4f5c0b1eff85
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.