Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #333 from avar/delete-MOD_PERL-instead-of-setting-…

…it-to-undef

Plack::Handler::Apache[12]: delete $ENV{MOD_PERL}, don't just localize i...
  • Loading branch information...
commit b8eadec8546fa1b0239c6ce714e198be4a7c85e4 2 parents aae534a + b7a63de
@miyagawa miyagawa authored
Showing with 22 additions and 2 deletions.
  1. +11 −1 lib/Plack/Handler/Apache1.pm
  2. +11 −1 lib/Plack/Handler/Apache2.pm
View
12 lib/Plack/Handler/Apache1.pm
@@ -20,7 +20,17 @@ sub preload {
sub load_app {
my($class, $app) = @_;
return $apps{$app} ||= do {
- local $ENV{MOD_PERL}; # trick Catalyst/CGI.pm etc.
+ # Trick Catalyst, CGI.pm, CGI::Cookie and others that check
+ # for $ENV{MOD_PERL}.
+ #
+ # Note that we delete it instead of just localizing
+ # $ENV{MOD_PERL} because some users may check if the key
+ # exists, and we do it this way because "delete local" is new
+ # in 5.12:
+ # http://perldoc.perl.org/5.12.0/perldelta.html#delete-local
+ local $ENV{MOD_PERL};
+ delete $ENV{MOD_PERL};
+
Plack::Util::load_psgi $app;
};
}
View
12 lib/Plack/Handler/Apache2.pm
@@ -28,7 +28,17 @@ sub preload {
sub load_app {
my($class, $app) = @_;
return $apps{$app} ||= do {
- local $ENV{MOD_PERL}; # trick Catalyst/CGI.pm etc.
+ # Trick Catalyst, CGI.pm, CGI::Cookie and others that check
+ # for $ENV{MOD_PERL}.
+ #
+ # Note that we delete it instead of just localizing
+ # $ENV{MOD_PERL} because some users may check if the key
+ # exists, and we do it this way because "delete local" is new
+ # in 5.12:
+ # http://perldoc.perl.org/5.12.0/perldelta.html#delete-local
+ local $ENV{MOD_PERL};
+ delete $ENV{MOD_PERL};
+
Plack::Util::load_psgi $app;
};
}
Please sign in to comment.
Something went wrong with that request. Please try again.