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=76bad625cf893f65e8165117405f3a561399fe1d;hb=a9a405db0d420172e69219fd71d2d39fd56167cf;hp=dd768f4570ef6322bc5b4ef24e648199057697c5;hpb=ee1ea13fb9f1694f769e4bf41366178079e16c06;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 dd768f4..76bad62 100644 --- a/t/aggregate/unit_core_engine_cgi-prepare_path.t +++ b/t/aggregate/unit_core_engine_cgi-prepare_path.t @@ -50,6 +50,45 @@ use Catalyst::Engine::CGI; 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/'; +} + +# 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/'; +} + + + + # FIXME - Test proxy logic # - Test query string # - Test non standard port numbers