X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=utils.lisp;h=ec42df6332429479e2994b18f666c3960903e149;hb=49f84ccd7347606524722e1c064027bb7c96c3a6;hp=97f6f76a76e1330a1b794084266c066c7ecee300;hpb=f63edd12886a0ed33be55f49c3284acca5db4797;p=cl-modlisp.git diff --git a/utils.lisp b/utils.lisp index 97f6f76..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.7 2003/07/16 20:40:43 kevin Exp $ +;;;; $Id: utils.lisp,v 1.10 2003/08/18 05:48:55 kevin Exp $ ;;;; ************************************************************************* (in-package #:modlisp) @@ -61,8 +61,10 @@ ,result))) (defun redirect-to-location (url) - (write-header-line "Status" "302 Redirect") + (write-header-line "Status" "307 Temporary Redirect") (write-header-line "Location" url) + ;;(write-header-line "Keep-Socket" "1") + ;;(write-header-line "Connection" "Keep-Alive") (write-string "end" *modlisp-socket*) (write-char #\NewLine *modlisp-socket*) (force-output *modlisp-socket*) @@ -88,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 @@ -98,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))))))) + +