Closed
Bug 1163028
Opened 10 years ago
Closed 9 years ago
URL: stop escaping [ and ] in path
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: annevk, Assigned: valentin)
References
()
Details
Attachments
(3 files, 2 obsolete files)
3.57 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
2.06 KB,
patch
|
Details | Diff | Splinter Review | |
3.38 KB,
patch
|
Details | Diff | Splinter Review |
Per excellent research in bug 1152455 comment 6 we're the only browser that escapes [ and ] in the path component of a URL. We should stop doing that.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8610870 -
Flags: review?(mcmanus)
Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8610872 -
Flags: review?(MattN+bmo)
Assignee | ||
Comment 3•9 years ago
|
||
Assignee | ||
Comment 4•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ad4d9f20ec7a
Comment 5•9 years ago
|
||
Comment on attachment 8610872 [details] [diff] [review] ospath_win.jsm: stop escaping [ and ] in toFileURI Review of attachment 8610872 [details] [diff] [review]: ----------------------------------------------------------------- It looks like ospath_unix.jsm has the same problem. Can you add a test to test_file_URL_conversion.js? If so, you probably don't need a spec/bug link in the code, only in the test. It's not clear to me that you're only changing the path escaping… do you know if any OSs support query parameters? I think you should get :Yoric to do the final review. ::: toolkit/components/osfile/modules/ospath_win.jsm @@ +311,5 @@ > // URI-escape forward slashes and convert backward slashes to forward > path = this.normalize(path).replace(/[\\\/]/g, m => (m=='\\')? '/' : '%2F'); > + > + // Per bug 1163028 we should not encode [] in the path > + let uri = encodeURI(path).replace(/%(5b|5d)/gi, If possible, could you link to a spec instead?
Attachment #8610872 -
Flags: review?(MattN+bmo) → review-
Updated•9 years ago
|
Attachment #8610870 -
Flags: review?(mcmanus) → review+
Assignee | ||
Comment 6•9 years ago
|
||
Attachment #8611425 -
Flags: review?(dteller)
Assignee | ||
Updated•9 years ago
|
Attachment #8610872 -
Attachment is obsolete: true
Comment on attachment 8611425 [details] [diff] [review] stop escaping [ and ] in toFileURI Review of attachment 8611425 [details] [diff] [review]: ----------------------------------------------------------------- I don't think that you're testing the Windows version of your code. ::: toolkit/components/osfile/modules/ospath_unix.jsm @@ +166,5 @@ > let toFileURIExtraEncodings = {';': '%3b', '?': '%3F', '#': '%23'}; > let toFileURI = function toFileURI(path) { > + // Per https://url.spec.whatwg.org we should not encode [] in the path > + let uri = encodeURI(this.normalize(path)).replace(/%(5b|5d)/gi, > + match => decodeURIComponent(match)); Calling `decodeURIComponent` just to decode %5b and %5d looks overkill, both here and in the Windows version.
Attachment #8611425 -
Flags: review?(dteller) → feedback+
Assignee | ||
Comment 8•9 years ago
|
||
Attachment #8616419 -
Flags: review?(dteller)
Assignee | ||
Updated•9 years ago
|
Attachment #8611425 -
Attachment is obsolete: true
Assignee | ||
Comment 9•9 years ago
|
||
(In reply to David Rajchenbach-Teller [:Yoric] (use "needinfo") from comment #7) > I don't think that you're testing the Windows version of your code. These are tested in test_file_URL_conversion.js // Test cases for filePathToURI let paths = isWindows ? [ [...] 'C:\\char[', 'C:\\char]',
So there already was a test in the Windows version, and this test already passed? In that case, why do you need to patch the Windows code?
Assignee | ||
Comment 11•9 years ago
|
||
(In reply to David Rajchenbach-Teller [:Yoric] (use "needinfo") from comment #10) > So there already was a test in the Windows version, and this test already > passed? In that case, why do you need to patch the Windows code? If we stop escaping [] in the C++ code, that test fails. That's why the changes in ospath_unix/win.jsm are necessary.
Comment on attachment 8616419 [details] [diff] [review] stop escaping [ and ] in toFileURI Review of attachment 8616419 [details] [diff] [review]: ----------------------------------------------------------------- In that case, r+.
Attachment #8616419 -
Flags: review?(dteller)
Assignee | ||
Comment 13•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=30005aa36d5d
Assignee | ||
Comment 14•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/c626dc6dc4fbf2a07efe0772e85e28bf2d03674c Bug 1163028 - URL: stop escaping [ and ] in path r=mcmanus https://hg.mozilla.org/integration/mozilla-inbound/rev/baecbc728aabae3cd3604cd13377fe1e079ccc86 Bug 1163028 - stop escaping [ and ] in toFileURI r=yoric https://hg.mozilla.org/integration/mozilla-inbound/rev/507c68ba9c7761ca780aa4c1fce38a4f5a53a056 Bug 1163028 - Fix WPT expectfails for urls containing [] a=testonly
Comment 15•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c626dc6dc4fb https://hg.mozilla.org/mozilla-central/rev/baecbc728aab https://hg.mozilla.org/mozilla-central/rev/507c68ba9c77
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 16•9 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/c626dc6dc4fb https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/baecbc728aab https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/507c68ba9c77
status-b2g-v2.5:
--- → fixed
Comment 17•9 years ago
|
||
removing the b2g 2.5 flag since this commit has been reverted due to an incorrect merge, sorry for the confusion
status-b2g-v2.5:
fixed → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•