[bknr-cvs] hans changed trunk/thirdparty/hunchentoot/request.lisp

BKNR Commits bknr at bknr.net
Wed Jul 22 16:29:01 UTC 2009


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

Patch by Peter Seibel, his words:

I think the actual problem I had was some code that did essentially:

 (with-foo-output ((send-headers))
    (expand-template-file))

where expand-template-file calls code that uses post-parameters to get
at, well, post parameters. It's not clear how to easily turn that code
inside out so all the parameters are gathered in advance of calling
send-headers.

U   trunk/thirdparty/hunchentoot/request.lisp

Modified: trunk/thirdparty/hunchentoot/request.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/request.lisp	2009-07-11 22:16:55 UTC (rev 4437)
+++ trunk/thirdparty/hunchentoot/request.lisp	2009-07-22 16:29:00 UTC (rev 4438)
@@ -352,7 +352,12 @@
   (get-parameters request))
 
 (defmethod post-parameters :before ((request request))
-  (maybe-read-post-parameters :request request))
+  ;; Force here because if someone calls POST-PARAMETERS they actually
+  ;; want them, regardless of why the RAW-POST-DATA has been filled
+  ;; in. (For instance, if SEND-HEADERS has been called, filling in
+  ;; RAW-POST-DATA, and then subsequent code calls POST-PARAMETERS,
+  ;; without the :FORCE flag POST-PARAMETERS would return NIL.)
+  (maybe-read-post-parameters :request request :force t))
 
 (defun post-parameters* (&optional (request *request*))
   "Returns an alist of the POST parameters associated with the REQUEST





More information about the Bknr-cvs mailing list