[hunchentoot-devel] Fwd: Problem with late calls to POST-PARAMETERS
Peter Seibel
peter at gigamonkeys.com
Tue Jul 21 23:09:30 UTC 2009
I sent this almost two months ago when Edi was very busy. I'm hoping
someone can tell me if this is a righteous patch.
-Peter
---------- Forwarded message ----------
From: Peter Seibel <peter at gigamonkeys.com>
Date: Mon, Jun 1, 2009 at 2:21 PM
Subject: Problem with late calls to POST-PARAMETERS
To: tbnl-devel at common-lisp.net
I ran into a problem converting some of my code to run with
Hunchentoot 1.0. This patch fixes it and -- as far as I can tell after
a bit of poking around -- is possibly righteous. What do you think?
The basic problem that I ran into is explained in the comment in the
patch.
-Peter
diff -r 635083ac9419 hunchentoot/request.lisp
--- a/hunchentoot/request.lisp Sun May 31 11:31:25 2009 -0700
+++ b/hunchentoot/request.lisp Mon Jun 01 14:19:19 2009 -0700
@@ -346,7 +346,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
--
Peter Seibel
http://www.codersatwork.com/
http://www.gigamonkeys.com/blog/
--
Peter Seibel
http://www.codersatwork.com/
http://www.gigamonkeys.com/blog/
More information about the Tbnl-devel
mailing list