Closed Bug 1403522 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: Networking, defect, P2)

57 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: me, Assigned: valentin)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

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: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: