[Laszlo-checkins] r11792 - openlaszlo/trunk/WEB-INF/lps/lfc/data

bargull@openlaszlo.org bargull at openlaszlo.org
Sat Nov 15 16:19:50 PST 2008


Author: bargull
Date: 2008-11-15 16:19:46 -0800 (Sat, 15 Nov 2008)
New Revision: 11792

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
Log:
Change 20081115-bargull-lNr by bargull at dell--p4--2-53 on 2008-11-15 18:21:04
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: fix for getResponseHeader()

New Features:

Bugs Fixed: LPP-7331

Technical Reviewer: henry
QA Reviewer: antun
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
Made "LzDataset#getResponseHeader(..)" working again and updated the doc:
- the function returns `null` for invalid header-names
- the function does not return all headers if the name-argument is omitted (this wasn't the case at least since LPS3.1.1)

Set response-headers in "LzHTTPDataProvider#loadResponse(..)" by calling "LzHTTPLoader#getResponseHeaders()", this works only in dhtml.
    

Tests:
testcase from bugreport in swf8/9 (proxied) and dhtml (proxied+unproxied)



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs	2008-11-15 23:48:16 UTC (rev 11791)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs	2008-11-16 00:19:46 UTC (rev 11792)
@@ -836,18 +836,25 @@
 }
 
 /**
-  * Returns the value for the specified response header, or false if there 
-  * was no header with that name.  If name is omitted, all response headers 
-  * are returned as an object of name/value pairs.
+  * Returns the value for the specified response header, or <code>null</code>
+  * if there was no header with that name.
   * 
   * @param String name: The name of the header to return
-  * @return String/Array: The value for the named header. If multiple headers 
+  * @return String/Array: The value for the named header. If multiple headers
   * are found, returns a list of values.
   * @return String
   */
 function getResponseHeader (name:String) :* {
-    var dreq:LzHTTPDataRequest = this.dataRequest;
-    return dreq ? dreq.responseheaders[ name ] : void(0);
+    var headers:LzParam = this.responseheaders;
+    if (headers) {
+        var val:Array = headers.getValues(name);
+        if (val && val.length == 1) {
+            return val[0];
+        } else {
+            return val;
+        }
+    }
+    return void(0);
 }
 
 /**

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs	2008-11-15 23:48:16 UTC (rev 11791)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs	2008-11-16 00:19:46 UTC (rev 11792)
@@ -325,6 +325,10 @@
             }
             if (data.childNodes[0].childNodes) content = data.childNodes[0].childNodes[0];
         } else {
+            var hos:* = dreq.loader.getResponseHeaders();
+            if (hos) {
+                headers.addObject(hos);
+            }
             // SOLO requests are raw XML data
             content = data;
         }



More information about the Laszlo-checkins mailing list