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=f8b08ef86bfdd547dd122eefff7f009cb893ed33;hb=62b6471146edafe1192f6f8d162b9dc7c3b5a6e7;hp=12eb98e5fec002c1c6083b0961e3e11073c4f1de;hpb=53f4422a068bffc33e8a03e09838413a5db5a360;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 12eb98e..f8b08ef 100644 --- a/t/aggregate/unit_core_engine_cgi-prepare_path.t +++ b/t/aggregate/unit_core_engine_cgi-prepare_path.t @@ -6,11 +6,6 @@ use lib "$Bin/../lib"; use TestApp; use Catalyst::Engine::CGI; -my %template = ( - HTTP_HOST => 'www.foo.com', - PATH_INFO => '/', -); - # mod_rewrite to app root for non / based app { my $r = get_req ( @@ -55,6 +50,20 @@ my %template = ( is ''.$r->base, 'http://www.foo.com/~bobtfish/Gitalist/script/gitalist.cgi/'; } +# Using rewrite rules to ask for a sub-path in your app. +# E.g. RewriteRule ^(.*)$ /path/to/fastcgi/domainprofi.fcgi/iframeredirect$1 [L,NS] +{ + my $r = get_req ( + PATH_INFO => '/iframeredirect/info', + SCRIPT_NAME => '', + REQUEST_URI => '/info', + ); + is ''.$r->uri, 'http://www.foo.com/iframeredirect/info'; + is ''.$r->base, 'http://www.foo.com/'; +} + + + # FIXME - Test proxy logic # - Test query string # - Test non standard port numbers @@ -62,7 +71,13 @@ my %template = ( # - Test scheme (secure request on port 80) sub get_req { + my %template = ( + HTTP_HOST => 'www.foo.com', + PATH_INFO => '/', + ); + local %ENV = (%template, @_); + my $i = TestApp->new; $i->engine(Catalyst::Engine::CGI->new); $i->engine->prepare_path($i);