Fix redirection
parent
680e028ccb
commit
95a4be3522
extra/http
|
@ -95,7 +95,7 @@ DEFER: (http-request)
|
||||||
SYMBOL: redirects
|
SYMBOL: redirects
|
||||||
|
|
||||||
: redirect-url ( request url -- request )
|
: redirect-url ( request url -- request )
|
||||||
'[ , >url ensure-port derive-url ensure-port ] change-url ;
|
'[ , >url derive-url ensure-port ] change-url ;
|
||||||
|
|
||||||
: do-redirect ( response data -- response data )
|
: do-redirect ( response data -- response data )
|
||||||
over code>> 300 399 between? [
|
over code>> 300 399 between? [
|
||||||
|
|
|
@ -225,6 +225,28 @@ test-db [
|
||||||
"http://localhost:1237/quit" http-get nip
|
"http://localhost:1237/quit" http-get nip
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! HTTP client redirect bug
|
||||||
|
[ ] [
|
||||||
|
[
|
||||||
|
<dispatcher>
|
||||||
|
add-quit-action
|
||||||
|
<action> [ "quit" <temporary-redirect> ] >>display
|
||||||
|
"redirect" add-responder
|
||||||
|
main-responder set
|
||||||
|
|
||||||
|
test-httpd
|
||||||
|
] with-scope
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
[ "Goodbye" ] [
|
||||||
|
"http://localhost:1237/redirect" http-get nip
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
|
||||||
|
[ ] [
|
||||||
|
[ "http://localhost:1237/quit" http-get 2drop ] ignore-errors
|
||||||
|
] unit-test
|
||||||
|
|
||||||
! Dispatcher bugs
|
! Dispatcher bugs
|
||||||
[ ] [
|
[ ] [
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue