summaryrefslogtreecommitdiff
path: root/main.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2009-10-08 18:13:46 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2009-10-08 18:13:46 +0200
commit9d2757de403c09a34b1bf777808069055d23c6ca (patch)
tree6724c5f71270dc7c4d6d4393a3e9e8346a481878 /main.lisp
parent1bb6b44043eb9b1b18d6c4eff5a9a113c107394a (diff)
When processing an Atom request, do not try to parse the POST data as a query string.
Ignore-this: 1b3a2318de3e658b4128b4abbaa33707 darcs-hash:b62d66cefb8bec7d817f72b315688871af406343
Diffstat (limited to 'main.lisp')
-rw-r--r--main.lisp26
1 files changed, 14 insertions, 12 deletions
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*)