]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www: remove gratuitous use of Plack::Request methods
authorEric Wong <e@80x24.org>
Mon, 30 May 2016 01:01:09 +0000 (01:01 +0000)
committerEric Wong <e@80x24.org>
Mon, 30 May 2016 01:01:09 +0000 (01:01 +0000)
Accessing $env directly is faster and we will eventually
remove all Plack::Request dependencies.

lib/PublicInbox/WWW.pm

index 88d4f6f099bc1a8629f73c9a8db6d888811cb4a5..a820207310ba93a9cfce073be39b0e7085ca8ebc 100644 (file)
@@ -41,9 +41,9 @@ sub call {
        my ($self, $env) = @_;
        my $cgi = Plack::Request->new($env);
        my $ctx = {cgi => $cgi, pi_config => $self->{pi_config}, www => $self};
-       my $path_info = $cgi->path_info;
+       my $path_info = $env->{PATH_INFO};
+       my $method = $env->{REQUEST_METHOD};
 
-       my $method = $cgi->method;
        if ($method eq 'POST' &&
                 $path_info =~ m!$INBOX_RE/(git-upload-pack)\z!) {
                my $path = $2;