Fix redirection

db4
Slava Pestov 2008-09-04 16:56:41 -05:00
parent 680e028ccb
commit 95a4be3522
2 changed files with 23 additions and 1 deletions

View File

@ -95,7 +95,7 @@ DEFER: (http-request)
SYMBOL: redirects
: 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 )
over code>> 300 399 between? [

View File

@ -225,6 +225,28 @@ test-db [
"http://localhost:1237/quit" http-get nip
] 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
[ ] [
[