r7061: initial property settings
[cl-modlisp.git] / utils.lisp
index 97f6f76a76e1330a1b794084266c066c7ecee300..9caf7d0b72cc722bbe955981f119b8f7d33b1375 100644 (file)
@@ -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$
 ;;;; *************************************************************************
 
 (in-package #:modlisp)
        ,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
        (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)))))))
+
+