Closed
Bug 1246475
Opened 9 years ago
Closed 1 year ago
file:/// URL containing %2F not working on windows
Categories
(Core :: Networking, defect, P3)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: sworddragon2, Unassigned, Mentored)
Details
(Keywords: good-first-bug, testcase, Whiteboard: [necko-backlog])
Attachments
(5 files)
354 bytes,
text/html
|
Details | |
635 bytes,
application/zip
|
Details | |
722 bytes,
patch
|
Details | Diff | Splinter Review | |
722 bytes,
patch
|
Details | Diff | Splinter Review | |
4.21 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 20160125225657
Steps to reproduce:
1. Download the testcase from the attachments.
2. Create the folder subdir in the same directory where the testcase is.
3. Create in subdir the file test.txt and write something in it.
4. Open the testcase and click all 4 links.
Actual results:
In Firefox (Linux) and Google Chrome (Windows and Linux) Link 1, Link 3 and Link 4 are working but in Firefox (Windows) only Link 1 and Link 3 are working.
Expected results:
Probably Link 4 should also work in Firefox on Windows.
Status: UNCONFIRMED → NEW
Component: Untriaged → Networking
Ever confirmed: true
Keywords: testcase
Product: Firefox → Core
Summary: Inconsistent behavior on opening encoded URL's → Inconsistent behavior when opening encoded URL
Comment 2•9 years ago
|
||
For regular URLs this seems to work just fine.
The problem seems to be for file:/// URLs. Most likely because %2F unescapes to / instead of \ ... and on windows this causes a problem when trying to open the file.
This requires a platform specific fix - mainly replacing %2F with \ in nsURLHelperWin.cpp in net_GetFileFromURLSpec, before doing NS_UnescapeURL(path).
Mentor: valentin.gosu
OS: Unspecified → Windows
Summary: Inconsistent behavior when opening encoded URL → file:/// URL containing %2F not working on windows
Whiteboard: [necko-backlog] [good first bug]
Comment 3•9 years ago
|
||
Hi! I'd like to work bug.
Comment 4•9 years ago
|
||
You can have it.
Updated•9 years ago
|
Assignee: nobody → dylan.seago
Status: NEW → ASSIGNED
Comment 5•9 years ago
|
||
Dylan, if you're having trouble with the bug let me know if I can help.
If you don't have time to take care of this right now, we can assign it to someone else in the mean time.
Comment 6•9 years ago
|
||
Comment 7•9 years ago
|
||
Fixed typo in initial patch suggestion
Comment 8•9 years ago
|
||
Comment 9•9 years ago
|
||
Thanks for the patch, Dylan.
If you don't mind, please move that line outside the if (!directory.IsEmpty()) block. This patch wouldn't fix use case in comment 0.
Also, I think we need to replace both %2F and %2f. You can apply attachment 8739280 [details] [diff] [review], build Firefox with ./mach build, then run the test with ./mach test netwerk/test/unit/test_file_protocol.js
If you need more info about hacking on Firefox feel free to ask, or you can check out the great resources at http://codefirefox.com/
Thanks!
Comment 10•9 years ago
|
||
Is this bug even valid? For example, Apache will treat <https://www.mozilla.jp/static/images/home%2ffirefox-20140310.png> and <https://www.mozilla.jp/static/images/home/firefox-20140310.png> are different. Why it does not on file: urls? Is this one of "all but us treat %2f in file: urls as /, so we will have to follow for web compat" things?
Comment 11•9 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #10)
> Is this one of "all but us treat
> %2f in file: urls as /, so we will have to follow for web compat" things?
Web compat is indeed an issue, but more important is the fact that we have different behaviours on Linux and Windows.
Comment 12•9 years ago
|
||
Then we should disallow %2f on Linux rather than allowing it on Windows. Other wise the site will suddenly stop to work when uploaded.
Comment 13•8 years ago
|
||
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P1
Comment 14•8 years ago
|
||
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: P1 → P3
Comment 15•7 years ago
|
||
let's check one by one.
link no 2 is not working because google has blocked google.com and changed it to country redirection,even though use it,it wonot work.
link no 4 is not working because here,subdir%2Ftest.txt is invalid path. you should remove %2f and place back slash there it look like this "subdir/test.txt"..
check now all the 3 links works...
Keywords: good-first-bug
Whiteboard: [necko-backlog] [good first bug] → [necko-backlog]
Comment 16•5 years ago
|
||
the assignee was disabled
Assignee: dylan.seago → nobody
Status: ASSIGNED → NEW
Updated•3 years ago
|
Severity: normal → S3
Comment 17•1 year ago
|
||
Testing in the latest Chrome (Version 120.0.6099.130) shows only links 1 and 3 working. Link 4 gives:
This site can’t be reached
The webpage at file:///J:/Misc/Firefox/subdir%2Ftest.txt might be temporarily down or it may have moved permanently to a new web address.
ERR_INVALID_URL
Firefox displays a blank page for link 4, no error message.
Should this bug be closed?
Comment 18•1 year ago
|
||
Yes, thank you for checking this.
It seems like all browsers agree now.
Closing as WORKSFORME - though it's the other browsers that have changed their behaviour.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•