[Catalyst] FastCGI fails with file extension mapped configuration
for IIS
Stuart Watt
swatt at infobal.com
Fri Dec 18 17:28:18 GMT 2009
I've used an IIS hack engine for a good while, and finally got around to =
switching to the main C::E::FastCGI with a few issues.
1. It works fine, apparently on IIS5
2. It does not work, at least not the way I have it configured, on IIS6
The issue revolves around the IIS handling of some request parameters; I =
get:
PATH_INFO: /m3analyst/arm.fcgi/index
PATH_TRANSLATED: C:\Sites\ARM\arm.fcgi\index
SCRIPT_NAME: /m3analyst/arm.fcgi
Problem #1 - the condition is: ( $env->{SERVER_SOFTWARE} =3D~ =
/IIS\/[6-9]\.[0-9]/ )
This seems to explain why IIS5 is not affected in the same way. The =
FastCGI component works just fine on IIS5, so I guess this ought to be =
included/processed.
Problem #2 - FastCGI engine cannot handle IIS with file extension mapped =
configuration for FastCGI
Obviously, IIS is broken with respect to some request parameters.
The algorthm for fixing IIS appears to be to pop items off a split =
PATH_INFO and a split PATH_TRANSLATED as long as they are the same, =
unshifting (!) the consistent items into a new value for PATH_INFO. =
Whatever was left on the old PATH_INFO is put into SCRIPT_NAME. The =
result of my request above, therefore, is:
PATH_INFO =3D /arm.fcgi/index
SCRIPT_NAME =3D /m3analyst
Since this is incorrect against the namespacing, Catalyst hits the =
default action for everything.
This ought to be:
PATH_INFO =3D /index
SCRIPT_NAME =3D /m3analyst/arm.fcgi
My hacky IIS engine did a rather simpler:
my $path =3D $env{PATH_INFO};
my $script =3D $env{SCRIPT_NAME};
my $length =3D length($script);
if (substr($path, 0, $length) eq $script) {
$env{PATH_INFO} =3D substr($path, $length);
}
i.e., I left SCRIPT_NAME alone, but removed it from the front of =
PATH_INFO when it matched exactly.
The documentation implies that a wildcard mapping is recommended =
(although this is not supported by IIS5). I suspect the algorithm is =
completely correct on IIS6/7 with a wildcard mapping.
Is this likely to require a patch to allow FastCGI to work with file =
extension mapping? Shall I write one?
All the best
Stuart
-- =
Stuart Watt
ARM Product Developer
Information Balance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20091218/0c577=
1d5/attachment.htm
More information about the Catalyst
mailing list