Cope with network error when considering redirection
This commit is contained in:
parent
98b62a5bc8
commit
a445c6860a
|
@ -71,8 +71,9 @@
|
||||||
(stop-when (message (web-response-complete req-id $resp $response-body))
|
(stop-when (message (web-response-complete req-id $resp $response-body))
|
||||||
(printf "~a <-- ~v ~v\n" req-id resp response-body)
|
(printf "~a <-- ~v ~v\n" req-id resp response-body)
|
||||||
(k resp response-body))))
|
(k resp response-body))))
|
||||||
(define location (dict-ref (web-response-header-headers resp) 'location #f))
|
(define location (and resp (dict-ref (web-response-header-headers resp) 'location #f)))
|
||||||
(if (and (eq? (web-response-header-code-type resp) 'redirection)
|
(if (and resp
|
||||||
|
(eq? (web-response-header-code-type resp) 'redirection)
|
||||||
(positive? redirect-budget)
|
(positive? redirect-budget)
|
||||||
location)
|
location)
|
||||||
(web-request! verb location
|
(web-request! verb location
|
||||||
|
|
Loading…
Reference in New Issue