Closed Bug 1558408 Opened 10 months ago Closed 5 months ago

nsDefaultURIFixup can't fix localhost:8080?param=1

Categories

(Core :: DOM: Navigation, defect, P3)

67 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: luthier1729, Assigned: Gijs)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

Steps to reproduce:

Enter localhost:8080?param=1

Actual results:

Firefox went to a Google search with "localhost:8080?param=1" in the search field

Expected results:

The URL http://localhost:8080?param=1 should have been opened. "localhost:8080" works fine, the problem seems to be only when having request parameters.

Hi @Gonzalo Rodríguez Píriz, here are the results of testing this issue:
Platform: Windows 10
Environment: latest nightly 69.0a1, beta 68.0b11 and release 67.0.3

  1. If I start the server (on my case XAMPP ) then access the link: http://localhost:8080?param=1 -> I cannot reproduce the issue. The localhost page will be opened.
  2. If the server will be stopped, or not being installed, then the following link is accessed: http://localhost:8080?param=1 -> the issue can be reproduced on all FF versions but also on other browser such as Chrome, the error: "This site can’t be reached" will be triggered. My guess is that on FF by entering a parameter in the end of a statement this "URL query (start with a question mark-followed by an argument and a value) " will be considered as a search term, as an intended action.
    So, In your case, the scenario of reproducing involves a server or not?
    Additionally, I will add a component to the and isn't the right one please fell free to change it.
Component: Untriaged → Networking: HTTP
Flags: needinfo?(luthier1729)
Product: Firefox → Core

Thank you very much for your research, @Liviu!

I have indeed a server started in the 8080 port, and the issue keeps happening.

The thing is, with the "http://" in front of the URL it works perfectly, the issue only happens when manually typing localhost:8080?param=1 on the address bar. To summarize:

  • Clicking on the link always works
  • Typing http://localhost:8080?param=1 works
  • Typing localhost:8080 works
  • Typing localhost:8080/?param=1 works (note the forward slash)
  • Typing localhost:8080?param=1 redirects to a Google search

Hope this helps :)

Flags: needinfo?(luthier1729)

Hi @Gonzalo Rodríguez Píriz, thanks for the info. You're right; I get the same results on Windows 10 & Mac OS X.
Additionally the result in the statement where appears the forward slash in my end is cause by: -not configuring the httpd.conf option "#Listen - where you must enter the default port "8080". (Here are the steps to do it if you use XAMPP: from XAMPP Control Panel window click on "Config" button->click on the 1st option "Apache(httpd.conf)"->scroll down to the "Listen" element where is the IP and port address )-> complete at the end of the IP address the port "8080"/ as well at the bellow option the click on "File" and Save the modifying actions.

Component: Networking: HTTP → Document Navigation
Summary: A localhost URL with request parameters is sent to Google Search → nsDefaultURIFixup can't fix localhost:8080?param=1
Attached patch fixup_test.diffSplinter Review

This test should not fail.

I'm not sure who deals with uri fixup these days. Perhaps Gijs?

Priority: -- → P3
Assignee: nobody → gijskruitbosch+bugs
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/2f0634afb2f3
fix fixup of host port URLs with querystrings or refs without forward slashes, r=valentin
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.