mirror of https://codeberg.org/cage/tinmop/
- [gemini] added better names for status code of a gemini response (e.g. '+20+' -> '+success+').
This commit is contained in:
parent
fb4be7bb9f
commit
f8bf6aa360
|
@ -33,11 +33,15 @@
|
|||
(code b))))
|
||||
|
||||
(defmacro gen-status-constant (value description)
|
||||
`(define-constant ,(format-fn-symbol t "+~a+" value)
|
||||
(make-instance 'response-status-code
|
||||
:code ,value
|
||||
:description ,description)
|
||||
:test #'response=))
|
||||
(with-gensyms (error-object)
|
||||
(let* ((clean-error-name (cl-ppcre:regex-replace-all "[-,.]" description ""))
|
||||
(splitted-error-name (cl-ppcre:split "\\s+" clean-error-name))
|
||||
(error-name-verbose (text-utils:join-with-strings splitted-error-name "-")))
|
||||
`(let ((,error-object (make-instance 'response-status-code
|
||||
:code ,value
|
||||
:description ,description)))
|
||||
(define-constant ,(format-fn-symbol t "+~a+" value) ,error-object :test #'response=)
|
||||
(define-constant ,(format-fn-symbol t "+~a+" error-name-verbose) ,error-object :test #'response=)))))
|
||||
|
||||
(gen-status-constant 10 "Input")
|
||||
|
||||
|
|
|
@ -126,6 +126,24 @@
|
|||
:description
|
||||
:find-code-description
|
||||
:find-code-class
|
||||
:+input+
|
||||
:+sensitive-input+
|
||||
:+success+
|
||||
:+redirect-temporary+
|
||||
:+redirect-permanent+
|
||||
:+temporary-failure+
|
||||
:+server-unavailable+
|
||||
:+cgi-error+
|
||||
:+proxy-error+
|
||||
:+slow-down+
|
||||
:+permanent-failure+
|
||||
:+not-found+
|
||||
:+gone+
|
||||
:+proxy-request-refused+
|
||||
:+bad-request+
|
||||
:+client-certificate-required+
|
||||
:+certificate-not-authorised+
|
||||
:+certificate-not-valid+
|
||||
:mime-gemini-p
|
||||
:mime-text-stream
|
||||
:gemini-protocol-error
|
||||
|
|
Loading…
Reference in New Issue