[Laszlo-checkins] r13664 - openlaszlo/trunk/WEB-INF/lps/lfc/data
hqm@openlaszlo.org
hqm at openlaszlo.org
Mon Apr 13 13:37:46 PDT 2009
Author: hqm
Date: 2009-04-13 13:37:44 -0700 (Mon, 13 Apr 2009)
New Revision: 13664
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
Log:
Change 20090411-hqm-G by hqm at badtzmaru.home on 2009-04-11 16:12:13 EDT
in /Users/hqm/openlaszlo/trunk5
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: make postbody get transmitted, regardless of other query params
New Features:
Bugs Fixed: LPP-8042
Technical Reviewer: a.bargull
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
+ Setting the postbody should always cause the raw data to be transmitted,
even in other query params have been set.
This implementation makes it so that setting postbody overrides any
query params, regardless of whether the call to set postbody comes
before or after the call set query params. Once postbody has been set,
the only way to disable it's action is to set postbody to null.
Tests:
run this in test/data
<canvas>
<dataset name="foo" src="http:echoUTF8.jsp"
request="false"
ontimeout="Debug.write(this.name + ': timed out')"
onerror="Debug.write(this.name + ': error')"
ondata="Debug.write('Response: ' + this.getPointer().serialize())" >
</dataset>
<simplelayout/>
<button text="post raw data">
<handler name="onclick">
foo.setAttribute('querytype', 'post');
foo.setQueryParam('flavor', 'vanilla');
foo.setAttribute('postbody', "This is a raw post body");
foo.doRequest();
</handler>
</button>
</canvas>
The returned data from the server should indicate that only the postbody value was
sent
calling foo.doRequest() <dataset>#1#0| #foo
Response: <foo><response><formcomponent method="POST" name="This is a raw post body" hex=""></formcomponent></response></foo>
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs 2009-04-13 20:11:49 UTC (rev 13663)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs 2009-04-13 20:37:44 UTC (rev 13664)
@@ -816,25 +816,25 @@
// Support for 'lzpostbody'. If this is a POST, set
// the DataRequest.postbody field to the lzpostbody value.
if (this.querytype.toUpperCase() == "POST") {
- var lzpostbody:String = this.postbody;
+ dreq.postbody = this.postbody;
+
+ // Dev Note: If there is a lzpostbody query arg, we are going
+ // to remove it from the query args, and set it as the
+ // dreq.postbody arg. Note: In SOLO mode, the DHTML runtime
+ // can actually support raw POST via the XMLHTTPRequest API.
+ //
+ // NB: The Flash swf8 native API has no way to support POST of
+ // arbitrary raw data in SOLO mode; the best we can do is to
+ // send a list of url-encoded key=value pairs.
if (dreq.queryparams) {
- // a "lzpostbody" arg overrides postbody, for back compatibility
- lzpostbody = dreq.queryparams.getValue('lzpostbody');
+ // a "lzpostbody" arg overrides postbody, for back
+ // compatibility
+ var lzpostbody = dreq.queryparams.getValue('lzpostbody');
if (lzpostbody != null) {
dreq.queryparams.remove('lzpostbody');
+ dreq.postbody = lzpostbody;
}
}
- // If there is a lzpostbody query arg, we are going to remove
- // it from the query args, and set it as the dreq.postbody
- // arg. Note: In SOLO mode, the DHTML runtime can actually
- // support raw POST via the XMLHTTPRequest API.
- //
- // The Flash swf8 native API has no way to support POST of
- // arbitrary raw data in SOLO mode; the best we can do is to
- // send a list of url-encoded key=value pairs.
- if (lzpostbody != null) {
- dreq.postbody = lzpostbody;
- }
}
dreq.proxied = this.isProxied();
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs 2009-04-13 20:11:49 UTC (rev 13663)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs 2009-04-13 20:37:44 UTC (rev 13664)
@@ -1,6 +1,6 @@
/**
*
- * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2009 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @access public
@@ -142,6 +142,7 @@
if (postbody == null && qparams != null) {
// Convert queryparams table into a URL-encoded query-style string
postbody = qparams.serialize('=', '&', true);
+
} else {
//We are asking the swf8 runtime to treat this as raw data, as best it can
hasquerydata = false;
More information about the Laszlo-checkins
mailing list