Iis redirect remove content #311

Merged
merged 1 commit into from Jul 18, 2012

Conversation

Projects
None yet
2 participants
@bobtfish
Member

bobtfish commented Jul 18, 2012

Middleware fix for errant IIS7 behavior, from a Catalyst bug: https://rt.cpan.org/Ticket/Display.html?id=78377

Add middleware to fix bad IIS7 bad behaviour.
https://rt.cpan.org/Ticket/Display.html?id=78377

Only applies to IIS version 7, with keepalives enabled.

IIS will happily read a 3XX response, and do the redirect,
sending it's own body to the client. The body of your redirect is
never read, meaning that the next client connection gets this
prepended to the HTTP header, which results in it getting
something insane looking, and generating a 500 page.

Apply with something like:

$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; }, );
    },
);
@miyagawa

This comment has been minimized.

Show comment Hide comment
@miyagawa

miyagawa Jul 18, 2012

Owner

Can/should this be implemented as a standalone pirce of middleware?

Owner

miyagawa commented Jul 18, 2012

Can/should this be implemented as a standalone pirce of middleware?

@miyagawa

This comment has been minimized.

Show comment Hide comment
@miyagawa

miyagawa Jul 18, 2012

Owner

I will get this merged for the consistency sake with the existing IIS middleware, but will move it out of core post 1.0.

Owner

miyagawa commented Jul 18, 2012

I will get this merged for the consistency sake with the existing IIS middleware, but will move it out of core post 1.0.

miyagawa added a commit that referenced this pull request Jul 18, 2012

@miyagawa miyagawa merged commit 2ef2952 into plack:master Jul 18, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment