Fix dsadinoff's mod_rewrite bug I hope
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_engine_cgi-prepare_path.t
index f8b08ef..39281cd 100644 (file)
@@ -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