Engine::HTTP - Fix paths for HTTP requests with scheme and domain in URI.
Gareth Kirwan [Fri, 7 Aug 2009 21:17:22 +0000 (21:17 +0000)]
lib/Catalyst/Engine/HTTP.pm

index 9626f66..91fb0a8 100644 (file)
@@ -368,6 +368,9 @@ sub _handler {
     while (1) {
         my ( $path, $query_string ) = split /\?/, $uri, 2;
 
+        # URI is not the same as path. Remove scheme, domain name and port from it
+        $path =~ s{^https?://[^/?#]+}{};
+
         # Initialize CGI environment
         local %ENV = (
             PATH_INFO       => $path         || '',