diff options
author | colin <colin@cicadas.surf> | 2024-09-06 21:47:24 -0700 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2024-09-06 21:47:24 -0700 |
commit | 1872584975829a68ab95d6b4adf1aabbd896ebc2 (patch) | |
tree | 0ca8db95e35ec4337584e0cf85bdc15aa1561eb7 /src | |
parent | 228d2ed37a71462e912be68bf76c01fd225f7d53 (diff) |
Add set-response-type function
Diffstat (limited to 'src')
-rw-r--r-- | src/package.lisp | 1 | ||||
-rw-r--r-- | src/protocol.lisp | 4 |
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)) |