From 9d2757de403c09a34b1bf777808069055d23c6ca Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Thu, 8 Oct 2009 18:13:46 +0200 Subject: When processing an Atom request, do not try to parse the POST data as a query string. Ignore-this: 1b3a2318de3e658b4128b4abbaa33707 darcs-hash:b62d66cefb8bec7d817f72b315688871af406343 --- main.lisp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'main.lisp') diff --git a/main.lisp b/main.lisp index d6b6448..f2dbc70 100644 --- a/main.lisp +++ b/main.lisp @@ -26,11 +26,6 @@ (defun call-with-initialised-journal (func) (let* ((*site* (if (file-exists-p #p"/home/mulk") :mst-plus :nfs.net)) (*debugging-p* (eq *site* :mst-plus)) - (*query* #+clisp (mapcan #'(lambda (param) - (list (keywordify param) - (http-query-parameter param))) - (http-query-parameter-list)) - #-clisp '()) (*http-env* (http-get-env-vars)) (*subpath-query* (subseq (gethash "REQUEST_URI" *http-env*) (length (ecase *site* @@ -42,11 +37,7 @@ (length *subpath-query*)))) (*subpath* (split-sequence #\/ *subpath-string* :remove-empty-subseqs t)) - (*post-number* (parse-integer (or (first *subpath*) - (getf *query* :id "")) - :junk-allowed t #|| :radix 12 ||#)) - (*action* (or (keywordify (getf *query* :action)) - (cond ((string= "feed" (first *subpath*)) :view-atom-feed) + (*action* (or (cond ((string= "feed" (first *subpath*)) :view-atom-feed) ((string= "comment-feed" (first *subpath*)) :view-comment-feed) ((string= "debug" (first *subpath*)) :view-debugging-page) ((string= "preview" (car (last *subpath*))) :preview-entry) @@ -54,8 +45,17 @@ ((string= "save" (car (last *subpath*))) :save-entry) ((string= "moderate" (car (last *subpath*))) :moderate) ((string= "atom" (car (last *subpath*))) :view-atom-entry) - (*post-number* :view) - (t nil)))) + (t nil)))) + (*query* #+clisp (if (eq *action* :view-atom-entry) + nil + (mapcan #'(lambda (param) + (list (keywordify param) + (http-query-parameter param))) + (http-query-parameter-list))) + #-clisp '()) + (*post-number* (parse-integer (or (first *subpath*) + (getf *query* :id "")) + :junk-allowed t #|| :radix 12 ||#)) (*method* (keywordify (gethash "REQUEST_METHOD" *http-env*))) (*if-modified-since* #+clisp (ext:getenv "HTTP_IF_MODIFIED_SINCE") #-clisp nil) @@ -83,6 +83,8 @@ (ecase *site* (:mst-plus #p"/usr/lib/") (:nfs.net #p"/usr/local/lib/"))))) + (when (null *action*) + (setq *action* (if *post-number* :view :index))) (clsql:push-library-path *script-dir*) (clsql:push-library-path #p"/usr/local/lib/") (push *script-dir* clsql-sys:*foreign-library-search-paths*) -- cgit v1.2.3