Localhost connection-refused hints don't appear when the URL has a port
Categories
(Toolkit :: Error Pages, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr153 | --- | unaffected |
| firefox159 | --- | unaffected |
| firefox160 | --- | unaffected |
| firefox161 | --- | fixed |
People
(Reporter: dekushrub519, Assigned: dekushrub519)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 external file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:159.0) Gecko/20100101 Firefox/159.0
Steps to reproduce
Bug 2079962 added developer-focused hints to the "Unable to connect" page when a
connection to a loopback address is refused. In practice they only appear for
URLs on the default port (e.g. http://localhost/), not for typical dev server
URLs such as http://127.0.0.1:5000/ (see bug 2079962 comment 4).
getLoopbackInfo() in toolkit/content/aboutNetErrorHelpers.mjs checks
document.location.host, which includes the port ("127.0.0.1:5000"), so the
localhost / 127.x / [::1] checks never match whenever a port is present. It
should use document.location.hostname.
The existing tests didn't catch this because they either pass a prebuilt
loopback context to getResolvedErrorConfig() or load an about:neterror URL
directly, so getLoopbackInfo() never ran against a real failed URL.
Steps to reproduce:
- Make sure nothing is listening on port 5000.
- Load http://127.0.0.1:5000/ (or http://localhost:5000/).
Actual results
Expected: "Nothing is accepting connections on port 5000. ..." hints.
Expected results
Actual: The generic "try again / check your network / firewall" hints.
Patch incoming, with a browser test that loads a real refused port.
| Assignee | ||
Updated•27 days ago
|
| Assignee | ||
Comment 1•27 days ago
|
||
location.host includes the port, so the loopback check never matched URLs
with an explicit port, such as http://127.0.0.1:5000/, and the loopback hints
were only shown on default ports.
Add a browser test that loads a real refused port, so getLoopbackInfo() runs
against an actual failed URL.
Updated•27 days ago
|
Comment 2•27 days ago
|
||
Set release status flags based on info from the regressing bug 2079962
Comment 4•27 days ago
|
||
| bugherder | ||
Updated•19 days ago
|
Description
•