Skip to content

Commit

Permalink
Add new http statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
n00p3 authored and stassats committed Sep 24, 2021
1 parent 18d7680 commit 460a32c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
21 changes: 19 additions & 2 deletions packages.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#:*header-stream*
#:*http-error-handler*
#:*hunchentoot-default-external-format*
#:*hunchentoot-version*
#:*hunchentoot-version*
#:*lisp-errors-log-level*
#:*lisp-warnings-log-level*
#:*log-lisp-backtraces-p*
Expand All @@ -68,36 +68,49 @@
#:*use-remote-addr-for-sessions*
#:*use-user-agent-for-sessions*
#:+http-accepted+
#:+http-already-reported+
#:+http-authorization-required+
#:+http-bad-gateway+
#:+http-bad-request+
#:+http-client-closed-request+
#:+http-conflict+
#:+http-connection-closed-without-response+
#:+http-continue+
#:+http-created+
#:+http-expectation-failed+
#:+http-failed-dependency+
#:+http-forbidden+
#:+http-gateway-time-out+
#:+http-gone+
#:+http-im-a-teapot+
#:+http-im-used+
#:+http-insufficient-storage+
#:+http-internal-server-error+
#:+http-length-required+
#:+http-locked+
#:+http-loop-detected+
#:+http-method-not-allowed+
#:+http-misdirected-request+
#:+http-moved-permanently+
#:+http-moved-temporarily+
#:+http-multi-status+
#:+http-multiple-choices+
#:+http-network-authentication-required+
#:+http-network-connect-timeout-error+
#:+http-no-content+
#:+http-non-authoritative-information+
#:+http-not-acceptable+
#:+http-not-extended
#:+http-not-found+
#:+http-not-implemented+
#:+http-not-modified+
#:+http-ok+
#:+http-partial-content+
#:+http-payment-required+
#:+http-permanent-redirect+
#:+http-precondition-failed+
#:+http-precondition-required+
#:+http-processing+
#:+http-proxy-authentication-required+
#:+http-request-entity-too-large+
#:+http-request-header-fields-too-large+
Expand All @@ -110,8 +123,12 @@
#:+http-switching-protocols+
#:+http-temporary-redirect+
#:+http-too-many-requests+
#:+http-unavailable-for-legal-reasons+
#:+http-unprocessable-entity+
#:+http-unsupported-media-type+
#:+http-upgrade-required+
#:+http-use-proxy+
#:+http-variant-also-negotiates+
#:+http-version-not-supported+
#:abort-request-handler
#:accept-connections
Expand All @@ -135,7 +152,7 @@
#:acceptor-request-class
#:acceptor-requests-in-progress
#:acceptor-ssl-p
#-:hunchentoot-no-ssl #:acceptor-ssl-certificate-file
#-:hunchentoot-no-ssl #:acceptor-ssl-certificate-file
#-:hunchentoot-no-ssl #:acceptor-ssl-privatekey-file
#-:hunchentoot-no-ssl #:acceptor-ssl-privatekey-password
#:acceptor-status-message
Expand Down
19 changes: 18 additions & 1 deletion specials.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ documentation string."

(defvar *http-reason-phrase-map* (make-hash-table)
"Used to map numerical return codes to reason phrases.")

(defmacro def-http-return-code (name value reason-phrase)
"Shortcut to define constants for return codes. NAME is a
Lisp symbol, VALUE is the numerical value of the return code, and
Expand All @@ -63,6 +63,7 @@ sequence.")

(def-http-return-code +http-continue+ 100 "Continue")
(def-http-return-code +http-switching-protocols+ 101 "Switching Protocols")
(def-http-return-code +http-processing+ 102 "Processing")
(def-http-return-code +http-ok+ 200 "OK")
(def-http-return-code +http-created+ 201 "Created")
(def-http-return-code +http-accepted+ 202 "Accepted")
Expand All @@ -71,13 +72,16 @@ sequence.")
(def-http-return-code +http-reset-content+ 205 "Reset Content")
(def-http-return-code +http-partial-content+ 206 "Partial Content")
(def-http-return-code +http-multi-status+ 207 "Multi-Status")
(def-http-return-code +http-already-reported+ 208 "Already Reported")
(def-http-return-code +http-im-used+ 226 "IM Used")
(def-http-return-code +http-multiple-choices+ 300 "Multiple Choices")
(def-http-return-code +http-moved-permanently+ 301 "Moved Permanently")
(def-http-return-code +http-moved-temporarily+ 302 "Moved Temporarily")
(def-http-return-code +http-see-other+ 303 "See Other")
(def-http-return-code +http-not-modified+ 304 "Not Modified")
(def-http-return-code +http-use-proxy+ 305 "Use Proxy")
(def-http-return-code +http-temporary-redirect+ 307 "Temporary Redirect")
(def-http-return-code +http-permanent-redirect+ 308 "Permanent Redirect")
(def-http-return-code +http-bad-request+ 400 "Bad Request")
(def-http-return-code +http-authorization-required+ 401 "Authorization Required")
(def-http-return-code +http-payment-required+ 402 "Payment Required")
Expand All @@ -96,17 +100,30 @@ sequence.")
(def-http-return-code +http-unsupported-media-type+ 415 "Unsupported Media Type")
(def-http-return-code +http-requested-range-not-satisfiable+ 416 "Requested range not satisfiable")
(def-http-return-code +http-expectation-failed+ 417 "Expectation Failed")
(def-http-return-code +http-im-a-teapot+ 418 "I'm a teapot")
(def-http-return-code +http-misdirected-request+ 421 "Misdirected Request")
(def-http-return-code +http-unprocessable-entity+ 422 "Unprocessable Entity")
(def-http-return-code +http-locked+ 423 "Locked")
(def-http-return-code +http-failed-dependency+ 424 "Failed Dependency")
(def-http-return-code +http-upgrade-required+ 426 "Upgrade Required")
(def-http-return-code +http-precondition-required+ 428 "Precondition Required")
(def-http-return-code +http-too-many-requests+ 429 "Too Many Requests")
(def-http-return-code +http-request-header-fields-too-large+ 431 "Request Header Fields Too Large")
(def-http-return-code +http-connection-closed-without-response+ 444 "Connection Closed Without Response")
(def-http-return-code +http-unavailable-for-legal-reasons+ 451 "Unavailable For Legal Reasons")
(def-http-return-code +http-client-closed-request+ 499 "Client Closed Request")
(def-http-return-code +http-internal-server-error+ 500 "Internal Server Error")
(def-http-return-code +http-not-implemented+ 501 "Not Implemented")
(def-http-return-code +http-bad-gateway+ 502 "Bad Gateway")
(def-http-return-code +http-service-unavailable+ 503 "Service Unavailable")
(def-http-return-code +http-gateway-time-out+ 504 "Gateway Time-out")
(def-http-return-code +http-version-not-supported+ 505 "Version not supported")
(def-http-return-code +http-variant-also-negotiates+ 506 "Variant Also Negotiates")
(def-http-return-code +http-insufficient-storage+ 507 "Insufficient Storage")
(def-http-return-code +http-loop-detected+ 508 "Loop Detected")
(def-http-return-code +http-not-extended+ 510 "Not Extended")
(def-http-return-code +http-network-authentication-required+ 511 "Network Authentication Required")
(def-http-return-code +http-network-connect-timeout-error+ 599 "Network Connect Timeout Error")

(defconstant +day-names+
#("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")
Expand Down

0 comments on commit 460a32c

Please sign in to comment.