Added `redirector-resource' from MASH.
This commit is contained in:
@ -84,3 +84,18 @@
|
|||||||
(return `(let ((,data-sym (parse-form-data ,request)))
|
(return `(let ((,data-sym (parse-form-data ,request)))
|
||||||
(let ,bindings
|
(let ,bindings
|
||||||
,@body)))))
|
,@body)))))
|
||||||
|
|
||||||
|
;;; Some further utility resources
|
||||||
|
|
||||||
|
;;; Redirection
|
||||||
|
|
||||||
|
(defclass redirector-resource (resource)
|
||||||
|
((code :initarg :code :initform +HTTP-Code-Moved-Temporarily+
|
||||||
|
:reader redirector-resource-code)
|
||||||
|
(destination :initarg :destination
|
||||||
|
:reader redirector-resource-destination)))
|
||||||
|
|
||||||
|
(defmethod access-resource ((resource redirector-resource) request)
|
||||||
|
(create-standard-response
|
||||||
|
request (redirector-resource-code resource)
|
||||||
|
:location (redirector-resource-destination resource)))
|
||||||
|
|||||||
Reference in New Issue
Block a user