Lines 24-30
use Mojo::Base 'Mojolicious::Plugin';
Link Here
|
24 |
use CGI; |
24 |
use CGI; |
25 |
use CGI::Compile; |
25 |
use CGI::Compile; |
26 |
use CGI::Emulate::PSGI; |
26 |
use CGI::Emulate::PSGI; |
27 |
use IO::Scalar; |
|
|
28 |
|
27 |
|
29 |
sub register { |
28 |
sub register { |
30 |
my ($self, $app, $conf) = @_; |
29 |
my ($self, $app, $conf) = @_; |
Lines 80-88
sub _psgi_env {
Link Here
|
80 |
my $env = $c->req->env; |
79 |
my $env = $c->req->env; |
81 |
|
80 |
|
82 |
my $body = $c->req->build_body; |
81 |
my $body = $c->req->build_body; |
|
|
82 |
open my $input, '<', \$body or die "Can't open in-memory scalar: $!"; |
83 |
$env = { |
83 |
$env = { |
84 |
%$env, |
84 |
%$env, |
85 |
'psgi.input' => IO::Scalar->new(\$body), |
85 |
'psgi.input' => $input, |
86 |
'psgi.errors' => *STDERR, |
86 |
'psgi.errors' => *STDERR, |
87 |
REQUEST_METHOD => $c->req->method, |
87 |
REQUEST_METHOD => $c->req->method, |
88 |
QUERY_STRING => $c->req->url->query->to_string, |
88 |
QUERY_STRING => $c->req->url->query->to_string, |
89 |
- |
|
|