about summary refs log tree commit homepage
path: root/lib/PublicInbox/Repobrowse.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-03-07 08:10:56 +0000
committerEric Wong <e@80x24.org>2016-04-05 18:58:27 +0000
commit2de5a44d184c25b162229690282a237adadbcb55 (patch)
tree6714e99bf83f1886cba5aa1af6455ce735d6a8f0 /lib/PublicInbox/Repobrowse.pm
parent2722ba03b74a782c0f64c7a6b1d09b7b82ff5478 (diff)
downloadpublic-inbox-2de5a44d184c25b162229690282a237adadbcb55.tar.gz
Make it closer to what the existing WWW interface is since
we no longer rely on CGI.pm
Diffstat (limited to 'lib/PublicInbox/Repobrowse.pm')
-rw-r--r--lib/PublicInbox/Repobrowse.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/PublicInbox/Repobrowse.pm b/lib/PublicInbox/Repobrowse.pm
index 51ec14c8..fe06a5be 100644
--- a/lib/PublicInbox/Repobrowse.pm
+++ b/lib/PublicInbox/Repobrowse.pm
@@ -20,6 +20,7 @@
 package PublicInbox::Repobrowse;
 use strict;
 use warnings;
+use Plack::Request;
 use URI::Escape qw(uri_escape_utf8 uri_unescape);
 use PublicInbox::RepobrowseConfig;
 
@@ -66,8 +67,10 @@ sub root_index {
         $mod->new->call($self->{rconfig}); # RepobrowseRoot::call
 }
 
-sub run {
-        my ($self, $cgi, $method) = @_;
+sub call {
+        my ($self, $env) = @_;
+        my $cgi = Plack::Request->new($env);
+        my $method = $cgi->method;
         return r(405, 'Method Not Allowed') if ($method !~ /\AGET|HEAD|POST\z/);
 
         # URL syntax: / repo [ / cmd [ / path ] ]