2 USING: http http.server.dispatchers http.server.responses
3 http.server furnace furnace.utilities tools.test kernel
4 namespaces accessors io.streams.string urls ;
5 TUPLE: funny-dispatcher < dispatcher ;
7 : <funny-dispatcher> funny-dispatcher new-dispatcher ;
9 TUPLE: base-path-check-responder ;
11 C: <base-path-check-responder> base-path-check-responder
13 M: base-path-check-responder call-responder*
15 "$funny-dispatcher" resolve-base-path
16 "text/plain" <content> ;
22 <base-path-check-responder> "c" add-responder
29 V{ } responder-nesting set
30 "a/b/c" split-path main-responder get call-responder body>>
33 [ "<input type='hidden' name='foo' value='&&&'/>" ]
34 [ [ "&&&" "foo" hidden-form-field ] with-string-writer ]
37 [ f ] [ <request> request [ referrer ] with-variable ] unit-test
39 [ t ] [ URL" http://foo" dup url [ same-host? ] with-variable ] unit-test
41 [ f ] [ f URL" http://foo" url [ same-host? ] with-variable ] unit-test