Created
April 20, 2012 15:08
-
-
Save bobtfish/2429475 to your computer and use it in GitHub Desktop.
Fix Plack::Handler::FCGI issues with nginx PATH_INFO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Plack::Middleware::FixFCGIPath; | |
| use strict; | |
| use warnings; | |
| use base qw/ Plack::Middleware /; | |
| sub call { | |
| my ($self, $env) = @_; | |
| if (length($env->{PATH_INFO})) { | |
| $env->{PATH_INFO} = '/' . $env->{PATH_INFO} | |
| unless $env->{PATH_INFO} =~ m{^/}; | |
| } | |
| return $self->app->($env); | |
| } | |
| 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment