Backlashes in URL are changed to slashes when page is loaded from local file
Categories
(Core :: Networking: File, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox124 | --- | verified |
People
(Reporter: mvorisek, Assigned: valentin)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Steps to reproduce:
Let's have a file test.html with:
<a href="foo#x\y">test</a>
and save it on local filesystem.
Now open the file in Firefox from local filesystem and hover the link. Notice the target URL.
Actual results:
Notice, the target URL is "file://...foo#x/y". (notice the "" in the fragment changed to "/").
This happen only when the file is opened from local filesystem. When opened from regular webserver/http/https, this issue is not present.
Also I am only Windows. On linux, I cannot test.
Expected results:
The URL fragment must never be normalized.
I expect "file://...foo#x\y" URL on hover and also when clicked.
Comment 2•9 months ago
|
||
I've reproduced this issue in the latest Nightly 118.0a1 and Firefox 116.0 versions on Windows 10 x64.
Setting the component and waiting for the developer's opinion about it.
If this is not the correct component, please feel free to change it to a more appropriate one.
Updated•9 months ago
|
Assignee | ||
Comment 3•3 months ago
|
||
This bug seems to have existed since bug 249282
The probem was that on windows we wanted to normalize the path of the
file URLs. When doing that bug 249282 also started normalizing the
inputs of relative file URLs, such that it triggers this bug.
When normalizing the input, the normalization should have stopped at the
'#' character. This patch fixes net_NormalizeFileURL to address that.
Since file URLs are only ever parsed with nsStandardURL and this
implementation already normalizes file paths for all special schemes
(file, http, https, etc) calling net_NormalizeFileURL before creating
a file URL is no longer needed, so we can remove the call in
NS_NewURI entirely.
Updated•3 months ago
|
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/5eb08718b0d7 Don't replace backslashes in the hash of the URL r=necko-reviewers,kershaw
Comment 5•3 months ago
|
||
bugherder |
Comment 6•3 months ago
|
||
I can no longer reproduce this issue in the latest Nightly 124.0a1 on Windows 10 x64 and Ubuntu 22.04.
Marking as VERIFIED FIXED.
Description
•