From: Tomas Doran Date: Wed, 18 Jul 2012 20:05:44 +0000 (+0100) Subject: Fix RT#78377 - IIS7 sucks in different ways to IIS6 X-Git-Tag: 5.90016~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=201e0a1fbca74dbe62eb5233df7861bcc7a384e9;hp=cfdd890d1f76bd9403c5b8a30f902394297ffb68 Fix RT#78377 - IIS7 sucks in different ways to IIS6 --- diff --git a/Changes b/Changes index 02cb8cb..baf322f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ # This file documents the revision history for Perl extension Catalyst. + - Fix RT#78377 - IIS7 ignores response body for 3xx requests, which + causes (a different) response to be broken when using keepalive. + Fixed by applying Middleware which removes the response body and + content length that Catalyst supplies with redirects. + 5.90015 - 2012-06-30 16:57:00 - Fix $c->finalize_headers getting called twice. RT#78090 - Fix test fails in Catalyst-Plugin-Session-State-Cookie. RT#76179 diff --git a/Makefile.PL b/Makefile.PL index 4b83510..c8ff69a 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -67,7 +67,7 @@ requires 'MooseX::Getopt' => '0.30'; requires 'MooseX::Types'; requires 'MooseX::Types::Common::Numeric'; requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace -requires 'Plack' => '0.9974'; # IIS6 fix middleware +requires 'Plack' => '0.9991'; # IIS6+7 fix middleware requires 'Plack::Middleware::ReverseProxy' => '0.04'; requires 'Plack::Test::ExternalServer'; diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 7009a53..2f6fe22 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -36,6 +36,7 @@ use Try::Tiny; use Plack::Middleware::Conditional; use Plack::Middleware::ReverseProxy; use Plack::Middleware::IIS6ScriptNameFix; +use Plack::Middleware::IIS7KeepAliveFix; use Plack::Middleware::LighttpdScriptNameFix; BEGIN { require 5.008003; } @@ -2793,6 +2794,16 @@ sub apply_default_middlewares { # IIS versions $psgi_app = Plack::Middleware::IIS6ScriptNameFix->wrap($psgi_app); + # And another IIS issue, this time with IIS7. + $psgi_app = Plack::Middleware::Conditional->wrap( + $psgi_app, + builder => sub { Plack::Middleware::IIS7KeepAliveFix->wrap($_[0]) }, + condition => sub { + my ($env) = @_; + return unless $env->{SERVER_SOFTWARE} && $env->{SERVER_SOFTWARE} =~ m!IIS\/7\.[0-9]!; 1; }, ); + }, + ); + return $psgi_app; }