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))))
|
(code b))))
|
||||||
|
|
||||||
(defmacro gen-status-constant (value description)
|
(defmacro gen-status-constant (value description)
|
||||||
`(define-constant ,(format-fn-symbol t "+~a+" value)
|
(with-gensyms (error-object)
|
||||||
(make-instance 'response-status-code
|
(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
|
:code ,value
|
||||||
:description ,description)
|
:description ,description)))
|
||||||
:test #'response=))
|
(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")
|
(gen-status-constant 10 "Input")
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,24 @@
|
||||||
:description
|
:description
|
||||||
:find-code-description
|
:find-code-description
|
||||||
:find-code-class
|
: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-gemini-p
|
||||||
:mime-text-stream
|
:mime-text-stream
|
||||||
:gemini-protocol-error
|
:gemini-protocol-error
|
||||||
|
|
Loading…
Reference in New Issue