Last Comment Bug 357901 - submission 'post' to file doesn't work
: submission 'post' to file doesn't work
: fixed1.8.0.12, fixed1.8.1.4
Product: Core
Classification: Components
Component: XForms (show other bugs)
: Trunk
: x86 All
: -- normal (vote)
: ---
Assigned To: aaronr
: Stephen Pride
Depends on:
  Show dependency treegraph
Reported: 2006-10-24 17:10 PDT by aaronr
Modified: 2007-04-23 16:13 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

testcase (1.99 KB, application/xhtml+xml)
2006-10-24 17:17 PDT, aaronr
no flags Details
patch (7.62 KB, patch)
2007-02-21 14:45 PST, aaronr
bugs: review+
Details | Diff | Review
patch2 (7.62 KB, patch)
2007-02-21 15:36 PST, aaronr
doronr: review+
Details | Diff | Review

Description aaronr 2006-10-24 17:10:29 PDT
If the form author specifies submission with @method="post" but uses a @action that is a local file, then we'll generate a xforms-submit-error.  This is because we assume that if the method type is post that the channel will be a nsIHttpChannel and bow out if it isn't.  Since other xforms processors don't generate an error with this scenario, I assume we are behaving incorrectly?

I talked to Jonas about it and he didn't think that there would be a security problem or anything if we treated POST like GET for all other protocols other than HTTP, which seems to be what XSmiles and formsPlayer do.

So should we do that or should we do the submission error like we do now and just put a better error in the Error Console?
Comment 1 aaronr 2006-10-24 17:17:07 PDT
Created attachment 243416 [details]
Comment 2 aaronr 2007-02-16 12:22:38 PST
started a thread in the WG mailing list (  Looks like it is non-normative (per Leigh's reply), so we can basically do what we like.  Unless we get some more feedback from the thread, I'd say we adopt formsPlayer's and XSmile's stance for replace="all" at least.  But should we continue to throw an error on replace="instance"?
Comment 3 Leigh L. Klotz, Jr. 2007-02-16 14:22:14 PST
Might give this one a day or two to see if anybody disagrees with me.
Comment 4 aaronr 2007-02-21 14:45:40 PST
Created attachment 255950 [details] [diff] [review]
Comment 5 aaronr 2007-02-21 14:48:04 PST
Comment on attachment 255950 [details] [diff] [review]

fixing bug by allowing "post" with file protocol when replace="all" or "none".  We'll put a warning in the error console for all other non-http protocols and when file is used with replace="instance".  And in the warning cases, a xforms-submit-error event will still be sent as happened before this patch.
Comment 6 Olli Pettay [:smaug] 2007-02-21 15:08:03 PST
Comment on attachment 255950 [details] [diff] [review]

>+  if (mFormat & METHOD_POST)
>+  {

if (mFormat & METHOD_POST) {
Comment 7 aaronr 2007-02-21 15:36:04 PST
Created attachment 255955 [details] [diff] [review]

fixes smaug's comment
Comment 8 aaronr 2007-02-24 13:52:52 PST
checked into trunk
Comment 9 aaronr 2007-04-23 16:13:46 PDT
checked into 1.8 branch on 2007-04-12
checked into 1.8.0 branch on 2007-04-16

Note You need to log in before you can comment on or make changes to this bug.