Permalink
Browse files

Plack::Handler::Apache2: add a new plack.handler.apache.request.objec…

…t key

Add a plack.handler.apache.request.object key which contains the
Apache request object, this allows the application to access the
original Apache request object. Originally I had used psgi.input for
this, but in some cases it's going to be overwritten to e.g.:

    bless( \*{'Plack::TempBuffer::PerlIO::$io'}, 'FileHandle' )

I think something like Plack::Request might be overwriting it, but in
any case we need a new key to access this since other things are going
to munge it.

This patch only adds a new key and doesn't change any existing ones,
it's best viewed with "git show -w".
  • Loading branch information...
1 parent 33a5552 commit 5eba0cebf3b49f5984011941b94637e765636978 @avar committed Oct 16, 2012
Showing with 13 additions and 12 deletions.
  1. +13 −12 lib/Plack/Handler/Apache2.pm
@@ -50,18 +50,19 @@ sub call_app {
my $env = {
%ENV,
- 'psgi.version' => [ 1, 1 ],
- 'psgi.url_scheme' => ($ENV{HTTPS}||'off') =~ /^(?:on|1)$/i ? 'https' : 'http',
- 'psgi.input' => $r,
- 'psgi.errors' => *STDERR,
- 'psgi.multithread' => Plack::Util::FALSE,
- 'psgi.multiprocess' => Plack::Util::TRUE,
- 'psgi.run_once' => Plack::Util::FALSE,
- 'psgi.streaming' => Plack::Util::TRUE,
- 'psgi.nonblocking' => Plack::Util::FALSE,
- 'psgix.harakiri' => Plack::Util::TRUE,
- 'psgix.cleanup' => Plack::Util::TRUE,
- 'psgix.cleanup.handlers' => [],
+ 'plack.handler.apache.request.object' => $r,
+ 'psgi.version' => [ 1, 1 ],
+ 'psgi.url_scheme' => ($ENV{HTTPS}||'off') =~ /^(?:on|1)$/i ? 'https' : 'http',
+ 'psgi.input' => $r,
+ 'psgi.errors' => *STDERR,
+ 'psgi.multithread' => Plack::Util::FALSE,
+ 'psgi.multiprocess' => Plack::Util::TRUE,
+ 'psgi.run_once' => Plack::Util::FALSE,
+ 'psgi.streaming' => Plack::Util::TRUE,
+ 'psgi.nonblocking' => Plack::Util::FALSE,
+ 'psgix.harakiri' => Plack::Util::TRUE,
+ 'psgix.cleanup' => Plack::Util::TRUE,
+ 'psgix.cleanup.handlers' => [],
};
if (defined(my $HTTP_AUTHORIZATION = $r->headers_in->{Authorization})) {

0 comments on commit 5eba0ce

Please sign in to comment.