[bknr-cvs] hans changed trunk/thirdparty/hunchentoot/

BKNR Commits bknr at bknr.net
Mon Aug 29 09:38:09 UTC 2011


Revision: 4675
Author: hans
URL: http://bknr.net/trac/changeset/4675

Be explicit about external format in test script.

Ignore GET parameter decoding errors, as they will presumably be fixed
by recompute-request-parameters.  --This line, and those below, will
be ignored--

M    test/script.lisp
M    test/script-engine.lisp
M    request.lisp

U   trunk/thirdparty/hunchentoot/request.lisp
U   trunk/thirdparty/hunchentoot/test/script-engine.lisp
U   trunk/thirdparty/hunchentoot/test/script.lisp

Modified: trunk/thirdparty/hunchentoot/request.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/request.lisp	2011-08-29 08:48:51 UTC (rev 4674)
+++ trunk/thirdparty/hunchentoot/request.lisp	2011-08-29 09:38:09 UTC (rev 4675)
@@ -196,7 +196,8 @@
           ;; compute GET parameters from query string and cookies from
           ;; the incoming 'Cookie' header
           (setq get-parameters
-                (form-url-encoded-list-to-alist (split "&" query-string))
+                (let ((*substitution-char* #\?))
+                  (form-url-encoded-list-to-alist (split "&" query-string)))
                 cookies-in
                 (form-url-encoded-list-to-alist (split "\\s*[,;]\\s*" (cdr (assoc :cookie headers-in
                                                                                   :test #'eq)))

Modified: trunk/thirdparty/hunchentoot/test/script-engine.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/test/script-engine.lisp	2011-08-29 08:48:51 UTC (rev 4674)
+++ trunk/thirdparty/hunchentoot/test/script-engine.lisp	2011-08-29 09:38:09 UTC (rev 4675)
@@ -168,9 +168,10 @@
                           cookie-jar
                           basic-authorization
                           parameters
-                          external-format-out)
+                          external-format-out
+                          additional-headers)
   (declare (ignore protocol method content content-type content-length cookie-jar basic-authorization
-                   range parameters external-format-out))
+                   range parameters external-format-out additional-headers))
   (setf *last-reply* (make-instance 'http-reply))
   (with-slots (body status-code headers uri stream close) *last-reply*
     (setf (values body status-code headers uri stream close)

Modified: trunk/thirdparty/hunchentoot/test/script.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/test/script.lisp	2011-08-29 08:48:51 UTC (rev 4674)
+++ trunk/thirdparty/hunchentoot/test/script.lisp	2011-08-29 09:38:09 UTC (rev 4675)
@@ -72,20 +72,26 @@
       (http-assert-body "\(HUNCHENTOOT-TEST::BAR . "DEF"\)"))
 
     (say "Test GET parameters with foreign characters (Latin-1)")
-    (http-request "parameter_latin1_get.html?foo=H%FChner")
+    (http-request "parameter_latin1_get.html"
+                  :external-format-out :iso-8859-1
+                  :parameters (list (cons "foo" (format nil "H~Chner" #.(code-char 252))))
+                  :additional-headers '(("Content-Type" . "text/plain; charset=iso-8859-1")))
     (http-assert-header :content-type "text/html; charset=ISO-8859-1")
     (http-assert-body "(72 252 104 110 101 114)")
     (http-assert-body ""Hühner"")
 
     (say "Test POST parameters with foreign characters (Latin-1)")
     (http-request "parameter_latin1_post.html"
+                  :external-format-out :iso-8859-1
                   :method :post :parameters (list (cons "foo" (format nil "H~Chner" #.(code-char 252)))))
     (http-assert-header :content-type "text/html; charset=ISO-8859-1")
     (http-assert-body "(72 252 104 110 101 114)")
     (http-assert-body ""Hühner"")
 
     (say "Test GET parameters with foreign characters (UTF-8)")
-    (http-request "parameter_utf8_get.html?foo=H%C3%BChner")
+    (http-request "parameter_utf8_get.html"
+                  :external-format-out :utf-8
+                  :parameters (list (cons "foo" (format nil "H~Chner" #.(code-char 252)))))
     (http-assert-header :content-type "text/html; charset=UTF-8")
     (http-assert-body "(72 252 104 110 101 114)")
     (http-assert-body ""Hühner"")





More information about the Bknr-cvs mailing list