aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))