From 21cf3d6a9a4be06deca4adea9de071f772fb1c57 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 30 May 2016 00:51:44 +0000 Subject: git-http-backend: remove dependency on Plack::Request Plack::Request is unnecessary overhead for this given the strictness of git-http-backend. Furthermore, having to make commit 311c2adc8c63 ("avoid Plack::Request parsing body") to avoid tempfiles should not have been necessary. --- t/git-http-backend.psgi | 6 ++---- t/git-http-backend.t | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 't') diff --git a/t/git-http-backend.psgi b/t/git-http-backend.psgi index c9607143..66f41505 100644 --- a/t/git-http-backend.psgi +++ b/t/git-http-backend.psgi @@ -6,7 +6,6 @@ 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); @@ -14,9 +13,8 @@ builder { 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"; diff --git a/t/git-http-backend.t b/t/git-http-backend.t index 889d507a..e8793923 100644 --- a/t/git-http-backend.t +++ b/t/git-http-backend.t @@ -13,7 +13,7 @@ use Cwd qw(getcwd); my $git_dir = $ENV{GIANT_GIT_DIR}; plan 'skip_all' => 'GIANT_GIT_DIR not defined' unless $git_dir; foreach my $mod (qw(Danga::Socket - Plack::Util Plack::Request Plack::Builder + Plack::Util Plack::Builder HTTP::Date HTTP::Status Net::HTTP)) { eval "require $mod"; plan skip_all => "$mod missing for git-http-backend.t" if $@; -- cgit v1.2.3-24-ge0c7