aboutsummaryrefslogtreecommitdiff
path: root/lazybones-hunchentoot.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lazybones-hunchentoot.lisp')
-rw-r--r--lazybones-hunchentoot.lisp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lazybones-hunchentoot.lisp b/lazybones-hunchentoot.lisp
index 2ed078c..38480a0 100644
--- a/lazybones-hunchentoot.lisp
+++ b/lazybones-hunchentoot.lisp
@@ -280,18 +280,17 @@ the value of the Content-Type request header."
(when secure (list :secure secure))
(when http-only (list :http-only http-only)))))
-(defun http-respond (content &optional (code 200))
+(defun http-respond (content)
"Final step preparing response before backend does the rest. For
-Hunchentoot, set the response code and a few headers. If content is a
-pathname, pass off to HUNCHENTOOT:HANDLE-STATIC-FILE, otherwise just
-return the content."
+Hunchentoot set a few headers. If content is a pathname, pass off to
+HUNCHENTOOT:HANDLE-STATIC-FILE, otherwise just return the content."
;; When http-err is called, the content is likely to be null. If
;; that is the case, look for the default content for the error
;; code, and set content and content-type appropriately
(a:when-let (data
(and (null content)
- (canned-response %server% code)))
+ (canned-response %server% (response-code))))
(destructuring-bind (source content-type) data
(setf (response-header :content-type) content-type
content (if (or (functionp source) (symbolp source))
@@ -299,7 +298,7 @@ return the content."
source))))
;; set the response code and header.
- (setf (response-code) code
+ (setf
(response-header :content-type) (or (response-header :content-type)
(when (pathnamep content)
(h:mime-type content))