Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/Plack/App/WrapCGI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ sub prepare_app {
close $stdoutr;
close $stdinw;

local %ENV = (%ENV, CGI::Emulate::PSGI->emulate_environment($env));
my %env = %ENV;
for (qw(REMOTE_HOST HTTP_AUTHORIZATION IFS CDPATH PATH LD_PRELOAD
LD_TRACE_LOADED_OBJECTS LD_WARN LD_DEBUG LD_AUDIT LD_VERBOSE))
{
delete $env{$_};
}
local %ENV = (%env, CGI::Emulate::PSGI->emulate_environment($env));

open( STDOUT, ">&=" . fileno($stdoutw) )
or Carp::croak "Cannot dup STDOUT: $!";
Expand Down
9 changes: 8 additions & 1 deletion lib/Plack/Handler/CGI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,15 @@ sub setup_env {
binmode STDIN;
binmode STDERR;

my %env = %ENV;
for (qw(REMOTE_HOST HTTP_AUTHORIZATION IFS CDPATH PATH LD_PRELOAD
LD_TRACE_LOADED_OBJECTS LD_WARN LD_DEBUG LD_AUDIT LD_VERBOSE))
{
delete $env{$_};
}

my $env = {
%ENV,
%env,
'psgi.version' => [ 1, 1 ],
'psgi.url_scheme' => ($ENV{HTTPS}||'off') =~ /^(?:on|1)$/i ? 'https' : 'http',
'psgi.input' => *STDIN,
Expand Down