Ok I found the "problem" (Actually, not the problem, but the reason for the double call and the ORing):
In (actions.lisp): *(defun get-request-action-name ()* * "Gets the name of the action from the request."* * (let* ((request-action-name (request-parameter *action-string*))* * (get/post-action-name (parameter *action-string*))* * (action-name (or request-action-name get/post-action-name)))* * action-name))* * * the call to *(request-parameter *action-string*) *is not reliable because (in utils/misc.lisp): *(defun request-parameter (name)* * "Get parameter 'name' from the request. If the request was* *submitted via GET method, the parameter is obtained from the* *query string. If the request was submitted via POST, the* *parameter is obtained from the body of the request. Otherwise, an* *error is signalled."* * (when (eq (request-method*) :head)* * (warn "User agent ~S sent a HEAD request" (hunchentoot:user-agent)))* * (ecase (request-method*)* * (:get (get-parameter name))* * (:post (post-parameter name))))* * * Now, if we have a POST request with the action-string as a GET parameter, request-parameter will return nil because although the request is a POST request, the action is a GET parameter so the ecase above will try to find *action-string* in the post parameters so it will return nil. That's why in get-request-action-name there is a safety OR with a direct call to hunchentoot:parameter: hunchentoot parameter searches both get and post parameters (in that order) and returns the first non-nil result. I think a more straightforward and simple way would be to call directly hunchentoot:parameter in get-request-action-name. My only problem about it is the one case that would not work with it: request is a POST request, and there are action string value pairs as both GET and POST parameters. In this case hunchentoot:parameter will return the GET action although the request is a POST one. Is this OK? Is this case even possible? I know all this is a bit too much fuss for something that isnt broke, so I will revert my changes and leave it as a note for a possible refactoring. Sorry again for the erroneous pull request. -- You received this message because you are subscribed to the Google Groups "weblocks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/weblocks?hl=en.
