Added number->status-code.
This commit is contained in:
parent
6a283ab875
commit
06121b3972
|
@ -98,6 +98,18 @@
|
|||
(vector-ref status-codes i))
|
||||
(else
|
||||
(loop (+ i 1)))))))
|
||||
|
||||
(define (number->status-code number)
|
||||
(if (not (number? number))
|
||||
(call-error number->status-code (list number))
|
||||
(let loop ((i 0))
|
||||
(cond ((= i (vector-length status-codes))
|
||||
#f)
|
||||
((= number
|
||||
(status-code-number (vector-ref status-codes i)))
|
||||
(vector-ref status-codes i))
|
||||
(else
|
||||
(loop (+ i 1)))))))
|
||||
|
||||
;;; (make-error-response status-code req [message . extras])
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -286,6 +286,7 @@
|
|||
status-code-message
|
||||
(status-code :syntax)
|
||||
name->status-code
|
||||
number->status-code
|
||||
|
||||
make-error-response
|
||||
make-redirect-response
|
||||
|
|
Loading…
Reference in New Issue