Closed
Bug 429128
Opened 17 years ago
Closed 17 years ago
Relative URI resolution broken in some cases
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla1.9
People
(Reporter: Biesinger, Assigned: Biesinger)
References
Details
(Keywords: regression)
Attachments
(2 files, 3 obsolete files)
846 bytes,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
beltzner
:
approval1.9+
|
Details | Diff | Splinter Review |
4.71 KB,
patch
|
Details | Diff | Splinter Review |
js> base = ios.newURI("http://www.example.com/#", null, null)
[xpconnect wrapped nsIURI]
js> base.nsIURL.query = "param=value"
param=value
js> base.spec
http://www.example.com/?param=value#
js> ios.newURI("#ref", null, base).spec
http://www.example.com/?#ref
Note that the query parameters are gone. They should not be. This was working correctly in Firefox 2.
Flags: blocking1.9?
Assignee | ||
Comment 1•17 years ago
|
||
Well actually this seems to be broken also in Firefox 2, but form submission doesn't seem to hit the bug there (it does on trunk)
Assignee | ||
Comment 2•17 years ago
|
||
(bug 392567 changed form submission to expose this bug)
Comment 3•17 years ago
|
||
Oh man, that seems pretty serious. I think we should fix this at least in the form-submission case, if not in general.
Assignee | ||
Comment 4•17 years ago
|
||
Unfortunately I can't test this until Friday at the earliest because I don't have a build environment here.
Comment 5•17 years ago
|
||
Michal can you jump in an verify this patch?
Comment 6•17 years ago
|
||
(In reply to comment #5)
> Michal can you jump in an verify this patch?
Yes, I'll post result in few minutes.
Comment 7•17 years ago
|
||
I can confirm that the patch works. Output when patch is applied:
js> var ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
js> var base = ios.newURI("http://www.example.com/#", null, null);
js> base.nsIURL.query = "param=value"
param=value
js> base.spec
http://www.example.com/?param=value#
js> ios.newURI("#ref", null, base).spec
http://www.example.com/?param=value#ref
Assignee | ||
Comment 8•17 years ago
|
||
Comment on attachment 315772 [details] [diff] [review]
patch
Did a tryserver build; this does fix the issue on the website I was seeing it on.
Attachment #315772 -
Flags: superreview?(bzbarsky)
Attachment #315772 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 9•17 years ago
|
||
for putting into netwerk/test/unit
Assignee | ||
Comment 10•17 years ago
|
||
Comment on attachment 315781 [details]
unit test
(note to self: fix the BUGID in this file)
Comment 11•17 years ago
|
||
For what it's worth, I have a slightly more extensive unit test for this, one which caught another bug in nsStandardURL, as far as I can tell. I'll post what I have.
Comment 12•17 years ago
|
||
The nsStandardURL change was needed because otherwise this case:
["http://example.com#bar", "http://example.com/?foo#bar"],
failed the equals() check, because the first URI had an mBasename segment with pos == 0, len == -1, while the second one had pos == 10, len == 0. I think those two segments should test true... If that's wrong, we should disble this one line, and fix the url parser to not produce a len == -1 basename, I guess.
Attachment #315796 -
Flags: superreview?(cbiesinger)
Attachment #315796 -
Flags: review?(cbiesinger)
Comment 13•17 years ago
|
||
Comment on attachment 315772 [details] [diff] [review]
patch
This looks good. See my test?
Attachment #315772 -
Flags: superreview?(bzbarsky)
Attachment #315772 -
Flags: superreview+
Attachment #315772 -
Flags: review?(bzbarsky)
Attachment #315772 -
Flags: review+
Assignee | ||
Comment 14•17 years ago
|
||
(In reply to comment #12)
> ["http://example.com#bar", "http://example.com/?foo#bar"],
I think it would be better to ensure that the mBasename fields are identical when the URIs have the same spec.
Comment 16•17 years ago
|
||
So... that would involve changing the urlparser bits or something. Not quite sure what. I'm certainly not in a position to do that safely at this point in a release (just don't have the time to learn the code).
So let's say we comment out that one line of test and file a followup bug on it, and I guess not make that nsStandardURL change?
Comment 17•17 years ago
|
||
Attachment #315796 -
Attachment is obsolete: true
Attachment #315903 -
Flags: superreview?(cbiesinger)
Attachment #315903 -
Flags: review?(cbiesinger)
Attachment #315796 -
Flags: superreview?(cbiesinger)
Attachment #315796 -
Flags: review?(cbiesinger)
Assignee | ||
Comment 18•17 years ago
|
||
Comment on attachment 315903 [details] [diff] [review]
Add a couple more tests
sounds good
Attachment #315903 -
Flags: superreview?(cbiesinger)
Attachment #315903 -
Flags: superreview+
Attachment #315903 -
Flags: review?(cbiesinger)
Attachment #315903 -
Flags: review+
Assignee | ||
Updated•17 years ago
|
Attachment #315772 -
Flags: approval1.9?
Assignee | ||
Updated•17 years ago
|
Attachment #315903 -
Flags: approval1.9?
Comment 19•17 years ago
|
||
Comment on attachment 315903 [details] [diff] [review]
Add a couple more tests
a=beltzner, but you don't need approvals for tests.
Attachment #315903 -
Flags: approval1.9? → approval1.9+
Comment 20•17 years ago
|
||
Comment on attachment 315772 [details] [diff] [review]
patch
a=beltzner, oh, sure, have approval for the patch, as well :)
Attachment #315772 -
Flags: approval1.9? → approval1.9+
Comment 21•17 years ago
|
||
I filed bug 429347 on the "com#bar" thing.
Attachment #315781 -
Attachment is obsolete: true
Attachment #315903 -
Attachment is obsolete: true
Assignee | ||
Comment 22•17 years ago
|
||
Checking in netwerk/base/src/nsStandardURL.cpp;
/cvsroot/mozilla/netwerk/base/src/nsStandardURL.cpp,v <-- nsStandardURL.cpp
new revision: 1.110; previous revision: 1.109
done
Checking in netwerk/test/unit/test_standardurl.js;
/cvsroot/mozilla/netwerk/test/unit/test_standardurl.js,v <-- test_standardurl.js
new revision: 1.2; previous revision: 1.1
done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9
Updated•17 years ago
|
Flags: in-testsuite+
Comment 23•17 years ago
|
||
Presumably, although I haven't tried too hard to untangle it, this was also bug 426332.
You need to log in
before you can comment on or make changes to this bug.
Description
•