Closed
Bug 392567
Opened 18 years ago
Closed 18 years ago
Impossible to submit forms to JAR URLs
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha8
People
(Reporter: jwkbugzilla, Assigned: jwkbugzilla)
References
Details
Attachments
(4 files, 3 obsolete files)
|
120 bytes,
application/octet-stream
|
Details | |
|
254 bytes,
text/html
|
Details | |
|
6.62 KB,
patch
|
jwkbugzilla
:
review+
sicking
:
superreview+
sicking
:
approval1.9+
|
Details | Diff | Splinter Review |
|
5.65 KB,
patch
|
Details | Diff | Splinter Review |
If I try to submit a GET form to a JAR URL the browser simply requests the form's action URI instead of attaching query parameters to it. Reason seems to be that nsFormSubmission uses nsIURI::SetPath that is not implemented by nsJARURI.
| Assignee | ||
Updated•18 years ago
|
Attachment #277073 -
Attachment is obsolete: true
| Assignee | ||
Updated•18 years ago
|
Attachment #277073 -
Attachment is obsolete: false
| Assignee | ||
Comment 1•18 years ago
|
||
Open this testcase, enter something into the text field and submit the form. The browser will open jar:https://bugzilla.mozilla.org/attachment.cgi?id=277073!/index.html instead of the expected jar:https://bugzilla.mozilla.org/attachment.cgi?id=277073!/index.html?test=some_text.
This example also shows that simply implementing SetPath in nsJARURI will not help, this URL already contains one query string and form submission should not change it. Instead, form submission should use GetFilePath and SetFilePath methods (if nsIURL is implemented).
| Assignee | ||
Updated•18 years ago
|
Component: Networking: JAR → HTML: Form Submission
QA Contact: networking.jar → form-submission
| Assignee | ||
Comment 2•18 years ago
|
||
Actually, it is better to use nsIURL::SetQuery().
Comment 3•18 years ago
|
||
Comment on attachment 277077 [details] [diff] [review]
Proposed patch
This is wrong, because if there is an existing query it doesn't remove it. I expect an automated regression test for this in the next patch version.
Why not just do a single SetQuery call when this is an nsIURL and do this rigmarole otherwise?
That said, I was sure we'd tried that once and it broke something, so if you go that route test well!
And perhaps jar URIs should implement SetPath? Not sure what form it would take, though, since there are two paths involved.
Attachment #277077 -
Flags: review?(bzbarsky) → review-
| Assignee | ||
Comment 4•18 years ago
|
||
Attaching new patch - now using nsIURL::SetQuery() whenever possible without even trying all the tricks meant for nsIURI. Also added a testcase and checked all existing mochitest testcases (no issues found). Will attach -w patch to make reviewing easier.
Attachment #277077 -
Attachment is obsolete: true
Attachment #277372 -
Flags: review?(bzbarsky)
| Assignee | ||
Comment 5•18 years ago
|
||
Comment 6•18 years ago
|
||
> checked all existing mochitest testcases
We don't really have any form submission tests yet....
In any case, the bug I was thinking of was bug 185169, so you should be OK here, I think. But please keep an eye on incoming bugs for a few weeks and watch out for form submission issues.
Comment 7•18 years ago
|
||
Comment on attachment 277373 [details] [diff] [review]
Patch v2 with -w
>Index: content/html/content/src/nsFormSubmission.cpp
> nsCAutoString path;
>+
> rv = aURI->GetPath(path);
Why add that blank line?
>Index: content/html/content/test/test_bug392567.html
>+ is(frame.location.href, expected, "Submitting to " + tests[currentTest][0] + ", expecting to see URL " + expected + " - seeing " + frame.location.href);
If this fails, |is| will report what it saw and what was expected. So I'd make the message just: "Submitting to " + tests[currentTest][0]
r=bzbarsky with those nits picked.
Updated•18 years ago
|
Attachment #277372 -
Flags: review?(bzbarsky) → review+
| Assignee | ||
Comment 8•18 years ago
|
||
Attachment #277372 -
Attachment is obsolete: true
Attachment #277373 -
Attachment is obsolete: true
Attachment #277508 -
Flags: superreview?
Attachment #277508 -
Flags: review+
| Assignee | ||
Updated•18 years ago
|
Attachment #277508 -
Flags: superreview? → superreview?(jonas)
| Assignee | ||
Comment 9•18 years ago
|
||
Attachment #277508 -
Flags: superreview?(jonas) → superreview+
| Assignee | ||
Updated•18 years ago
|
Keywords: checkin-needed
| Assignee | ||
Comment 10•18 years ago
|
||
Comment on attachment 277508 [details] [diff] [review]
Patch v3
Requesting approval for 1.9: This fixes a bug that prevents using jar: urls like regular http: or file: URLs. In my case this was necessary to distribute lots of help files in one single archive, something that I think is required rather often.
Attachment #277508 -
Flags: approval1.9?
Comment 11•18 years ago
|
||
Doesn't seem to be anything checkin-needed yet, if you're still waiting on approval.
Keywords: checkin-needed
Attachment #277508 -
Flags: approval1.9? → approval1.9+
| Assignee | ||
Updated•18 years ago
|
Keywords: checkin-needed
Comment 12•18 years ago
|
||
Checking in content/html/content/src/nsFormSubmission.cpp;
/cvsroot/mozilla/content/html/content/src/nsFormSubmission.cpp,v <-- nsFormSubmission.cpp
new revision: 1.60; previous revision: 1.59
done
Checking in content/html/content/test/Makefile.in;
/cvsroot/mozilla/content/html/content/test/Makefile.in,v <-- Makefile.in
new revision: 1.28; previous revision: 1.27
done
RCS file: /cvsroot/mozilla/content/html/content/test/test_bug392567.html,v
done
Checking in content/html/content/test/test_bug392567.html;
/cvsroot/mozilla/content/html/content/test/test_bug392567.html,v <-- test_bug392567.html
initial revision: 1.1
done
Updated•18 years ago
|
Flags: in-testsuite+
Updated•18 years ago
|
Target Milestone: --- → mozilla1.9 M8
Updated•6 years ago
|
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•