X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_core_engine_cgi-prepare_path.t;h=39281cd0dade4e4b50205a4c973e1d1a2b7e9b62;hb=46b58c90d2cae855b523a375d56f874fd28665d3;hp=f8b08ef86bfdd547dd122eefff7f009cb893ed33;hpb=b760ac3de30354fa5e1e7969c21f31521f0d1783;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_engine_cgi-prepare_path.t b/t/aggregate/unit_core_engine_cgi-prepare_path.t index f8b08ef..39281cd 100644 --- a/t/aggregate/unit_core_engine_cgi-prepare_path.t +++ b/t/aggregate/unit_core_engine_cgi-prepare_path.t @@ -62,6 +62,40 @@ use Catalyst::Engine::CGI; is ''.$r->base, 'http://www.foo.com/'; } +# nginx example from espent with path /"foo" +{ + my $r = get_req ( + PATH_INFO => '"foo"', + SCRIPT_NAME => '/', + REQUEST_URI => '/%22foo%22', + ); + is ''.$r->path, '%22foo%22'; + is ''.$r->uri, 'http://www.foo.com/%22foo%22'; + is ''.$r->base, 'http://www.foo.com/'; +} + +# nginx example from espent with path /"foo" and the app based at /oslobilder +{ + my $r = get_req ( + PATH_INFO => 'oslobilder/"foo"', + SCRIPT_NAME => '/oslobilder/', + REQUEST_URI => '/oslobilder/%22foo%22', + ); + is ''.$r->path, '%22foo%22'; + is ''.$r->uri, 'http://www.foo.com/oslobilder/%22foo%22'; + is ''.$r->base, 'http://www.foo.com/oslobilder/'; +} + +{ + my $r = get_req ( + PATH_INFO => '/auth/login', + SCRIPT_NAME => '/tx', + REQUEST_URI => '/login', + ); + is ''.$r->path, 'auth/login'; + is ''.$r->uri, 'http://www.foo.com/tx/auth/login'; + is ''.$r->base, 'http://www.foo.com/tx/'; +} # FIXME - Test proxy logic