Commit 5b7061c6fe3c1a9b11cc2326b2c5950d287b61e2

Thomas de Grivel 2018-06-09T18:50:51

fix request-content-length

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/thot.lisp b/thot.lisp
index 88f1651..452ef5f 100644
--- a/thot.lisp
+++ b/thot.lisp
@@ -151,7 +151,9 @@
   `(setf (gethash ,header-name (request-headers ,request)) ,value))
 
 (defun request-content-length (&optional (request *request*))
-  (parse-integer (request-header "Content-Length" request)))
+  (let ((header (request-header "Content-Length" request)))
+    (when header
+      (parse-integer header))))
 
 ;;  HTTP parser