Commit e693c02f0e102faacf22ff88ce71c26bf22a7df7

Thomas de Grivel 2018-06-09T18:49:58

request method is a symbol

diff --git a/thot.lisp b/thot.lisp
index 5bdde9b..05982f7 100644
--- a/thot.lisp
+++ b/thot.lisp
@@ -14,6 +14,12 @@
     (defconstant +crlf+
       (coerce '(#\Return #\Newline) 'string))))
 
+;;  Methods
+
+(let ((request-methods '(get post put head)))
+  (defun http-method (x)
+    (find x request-methods :test #'string=)))
+
 ;;  Request
 
 (defclass request ()
@@ -185,7 +191,8 @@
       (with-readers-for stream
           ((method (char)
              (cond ((char= #\Space char)
-                    (setf (request-method% request) (get-buffer))
+                    (setf (request-method% request)
+                          (http-method (get-buffer)))
                     (target))
                    (t (stream-write buffer char)
                       (method))))