aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2024-09-06 21:47:24 -0700
committercolin <colin@cicadas.surf>2024-09-06 21:47:24 -0700
commit1872584975829a68ab95d6b4adf1aabbd896ebc2 (patch)
tree0ca8db95e35ec4337584e0cf85bdc15aa1561eb7
parent228d2ed37a71462e912be68bf76c01fd225f7d53 (diff)
Add set-response-type function
-rw-r--r--src/package.lisp1
-rw-r--r--src/protocol.lisp4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/package.lisp b/src/package.lisp
index 094295b..389609e 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -47,5 +47,6 @@
#:class-initargs
#:body-expected-p
#:request-method
+ #:set-response-type
))
diff --git a/src/protocol.lisp b/src/protocol.lisp
index 6951077..3bbe983 100644
--- a/src/protocol.lisp
+++ b/src/protocol.lisp
@@ -213,3 +213,7 @@ string or keyword."
(defun err (&key (code 400) (content "Bad Request") (mimetype "text/plain"))
"Signal an error and abort request."
(error 'request-error :code code :content content :mimetype mimetype))
+
+(defun set-response-type (mimetype)
+ "Set the Content-Type header of the response."
+ (setf (http:content-type*) mimetype))