]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/git-http-backend.psgi
No ext_urls
[public-inbox.git] / t / git-http-backend.psgi
index 8cec7d35365b69ac1fd42fedbd585c92df0e39e3..a91e5de83208384b117154fd3e7e5f6d2a335e77 100644 (file)
@@ -1,23 +1,20 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2016 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
 use PublicInbox::GitHTTPBackend;
 use PublicInbox::Git;
 use Plack::Builder;
-use Plack::Request;
 use BSD::Resource qw(getrusage);
 my $git_dir = $ENV{GIANT_GIT_DIR} or die 'GIANT_GIT_DIR not defined in env';
 my $git = PublicInbox::Git->new($git_dir);
 builder {
-       enable 'Chunked' if $ENV{TEST_CHUNK};
        enable 'Head';
        sub {
                my ($env) = @_;
-               my $pr = Plack::Request->new($env);
-               if ($pr->path_info =~ m!\A/(.+)\z!s) {
-                       PublicInbox::GitHTTPBackend::serve($pr, $git, $1);
+               if ($env->{PATH_INFO} =~ m!\A/(.+)\z!s) {
+                       PublicInbox::GitHTTPBackend::serve($env, $git, $1);
                } else {
                        my $ru = getrusage();
                        my $b = $ru->maxrss . "\n";