X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=utils.lisp;h=ec42df6332429479e2994b18f666c3960903e149;hb=49f84ccd7347606524722e1c064027bb7c96c3a6;hp=b6302460c3f9e43c889a67781d675fb0c561ba08;hpb=52863e3fbf81d9caca73e11803b9cbc9ed57f623;p=cl-modlisp.git diff --git a/utils.lisp b/utils.lisp index b630246..ec42df6 100644 --- a/utils.lisp +++ b/utils.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Dec 2002 ;;;; -;;;; $Id: utils.lisp,v 1.8 2003/07/19 20:32:47 kevin Exp $ +;;;; $Id: utils.lisp,v 1.10 2003/08/18 05:48:55 kevin Exp $ ;;;; ************************************************************************* (in-package #:modlisp) @@ -61,7 +61,7 @@ ,result))) (defun redirect-to-location (url) - (write-header-line "Status" "301 Moved Permanently") + (write-header-line "Status" "307 Temporary Redirect") (write-header-line "Location" url) ;;(write-header-line "Keep-Socket" "1") ;;(write-header-line "Connection" "Keep-Alive") @@ -90,7 +90,7 @@ ;; Utility functions for library users -(defun query-to-alist (posted-string) +(defun query-to-alist (posted-string &key (keyword t)) "Converts a posted string to an assoc list of keyword names and values, \"a=1&bc=demo\" => ((:a . \"1\") (:bc . \"demo\"))" (when posted-string @@ -100,7 +100,11 @@ (let ((name-val-list (kmrcl:delimited-string-to-list name=val #\=))) (if (= 2 (length name-val-list)) (destructuring-bind (name val) name-val-list - (push (cons (kmrcl:ensure-keyword name) + (push (cons (if keyword + (kmrcl:ensure-keyword name) + name) (kmrcl:decode-uri-query-string val)) alist)) (cmsg-c :debug "Invalid number of #\= in ~S" name-val-list))))))) + +