[Catalyst-commits] r13061 - in
Catalyst-Runtime/5.80/branches/fix_iis_cgi:
lib/Catalyst/Engine t/aggregate
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Mon Mar 22 10:40:52 GMT 2010
Author: caelum
Date: 2010-03-22 10:40:52 +0000 (Mon, 22 Mar 2010)
New Revision: 13061
Modified:
Catalyst-Runtime/5.80/branches/fix_iis_cgi/lib/Catalyst/Engine/CGI.pm
Catalyst-Runtime/5.80/branches/fix_iis_cgi/t/aggregate/unit_core_engine_cgi-prepare_path.t
Log:
fix for CGI on IIS
Modified: Catalyst-Runtime/5.80/branches/fix_iis_cgi/lib/Catalyst/Engine/CGI.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/fix_iis_cgi/lib/Catalyst/Engine/CGI.pm 2010-03-22 10:30:30 UTC (rev 13060)
+++ Catalyst-Runtime/5.80/branches/fix_iis_cgi/lib/Catalyst/Engine/CGI.pm 2010-03-22 10:40:52 UTC (rev 13061)
@@ -117,6 +117,12 @@
my $scheme = $c->request->secure ? 'https' : 'http';
my $host = $ENV{HTTP_HOST} || $ENV{SERVER_NAME};
my $port = $ENV{SERVER_PORT} || 80;
+
+ # fix up for IIS
+ if ($ENV{SERVER_SOFTWARE} && $ENV{SERVER_SOFTWARE} =~ m{IIS/[6-9]\.\d}) {
+ $ENV{PATH_INFO} =~ s/^\Q$ENV{SCRIPT_NAME}\E//;
+ }
+
my $script_name = $ENV{SCRIPT_NAME};
$script_name =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go if $script_name;
Modified: Catalyst-Runtime/5.80/branches/fix_iis_cgi/t/aggregate/unit_core_engine_cgi-prepare_path.t
===================================================================
--- Catalyst-Runtime/5.80/branches/fix_iis_cgi/t/aggregate/unit_core_engine_cgi-prepare_path.t 2010-03-22 10:30:30 UTC (rev 13060)
+++ Catalyst-Runtime/5.80/branches/fix_iis_cgi/t/aggregate/unit_core_engine_cgi-prepare_path.t 2010-03-22 10:40:52 UTC (rev 13061)
@@ -86,9 +86,20 @@
is ''.$r->base, 'http://www.foo.com/oslobilder/';
}
+# CGI hit on IIS for non / based app
+{
+ my $r = get_req (
+ SERVER_SOFTWARE => 'Microsoft-IIS/6.0',
+ PATH_INFO => '/bobtfish/Gitalist/script/gitalist.cgi/static/css/blueprint/screen.css',
+ SCRIPT_NAME => '/bobtfish/Gitalist/script/gitalist.cgi',
+ PATH_TRANSLATED =>
+'C:\\Inetpub\\vhosts\\foo.com\\httpdocs\\bobtfish\\Gitalist\\script\\gitalist.cgi\\static\\css\\blueprint\\screen.css',
+ );
+ is ''.$r->uri, 'http://www.foo.com/bobtfish/Gitalist/script/gitalist.cgi/static/css/blueprint/screen.css';
+ is ''.$r->base, 'http://www.foo.com/bobtfish/Gitalist/script/gitalist.cgi/';
+}
-
# FIXME - Test proxy logic
# - Test query string
# - Test non standard port numbers
More information about the Catalyst-commits
mailing list