Open Bug 854151 Opened 12 years ago Updated 2 years ago

"Unable to connect" error doesn't show localhost domain name in View source

Categories

(Core :: DOM: Navigation, defect)

20 Branch
x86
Linux
defect

Tracking

()

People

(Reporter: mjh563, Unassigned)

Details

Attachments

(3 files)

Attached file testcase
Steps to reproduce: [Prerequisite: don't have a server running on localhost] 1. Load the attachment, which contains an image located at a localhost URL 2. View the page source (Ctrl+U) 3. Click the image src link in the page source Expected result: "Unable to connect - Firefox can't establish a connection to the server at localhost." Actual result: The error message is shown, but the 'localhost' domain name is missing: "Unable to connect - Firefox can't establish a connection to the server at ."
Attachment #728676 - Attachment mime type: text/plain → text/html
It only seems to happen with localhost. If the image is located on a non-existent or inaccessible real domain, then you get the expected result ("Firefox can't establish a connection to the server at [domain name]"). Also, it's only reproducible when clicking the link in the page source. If you right-click the broken image icon and select View Image, you get the expected result.
Reproduced with 2013-03-26-03-09-41-mozilla-central-firefox-22.0a1.en-US.linux-x86_64
Status: UNCONFIRMED → NEW
Ever confirmed: true
Simpler StR: [Prerequisite: don't have a server running on localhost] 1. Enter http://localhost/bla in the address bar and press Enter. 2. View source.
Component: Untriaged → View Source
Product: Firefox → Toolkit
Summary: "Unable to connect" error doesn't show localhost domain name in certain circumstances → "Unable to connect" error doesn't show localhost domain name in View source
This bug is not specific to localhost, as I first thought. It will always happen on certain error pages, regardless of the URL. It was partly fixed back in bug 393002, but only for "Server not found" errors. Other error pages are still affected. For example, the following URLs all trigger the bug. The hostname or other link-specific part of the error message that's shown in the view source window is either missing or incorrect: http://localhost x://x file:///invalid http://www.mozilla.org/firefox/its-a-trap.html (STR: load the link, then view source - the view source window should show exactly the same error message as the main page) This one doesn't trigger the bug though, because the "Server not found" error page was fixed in bug 393002: http://invalid.domain.abcdef
Aleksej, could you assign the bug to me please? I'm working on a fix for it.
Wasn't "take" displayed for you?
Assignee: nobody → mjh563
Status: NEW → ASSIGNED
Thanks. (In reply to Aleksej [:Aleksej] from comment #7) > Wasn't "take" displayed for you? No, I don't seem to have that option. :(
Component: View Source → Document Navigation
Product: Toolkit → Core
Attached patch patchSplinter Review
This patch just extends the fix from bug 393002 to apply to all errors shown using the standard error page (about:neterror). Errors shown using about:certerror and about:blocked are still wrong though, because those pages have their own way of getting the hostname. I'll file a separate bug to fix those.
Attachment #778890 - Flags: review?(bzbarsky)
Comment on attachment 778890 [details] [diff] [review] patch Why is this only being done for view-source? What about other nested URIs?
Attachment #778890 - Flags: review?(bzbarsky) → review-

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: mjh563 → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: