about summary refs log tree commit homepage
path: root/lib/PublicInbox/WWW.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-02-02 04:00:08 +0000
committerEric Wong <e@80x24.org>2016-02-02 04:07:19 +0000
commitd39a8a440c9b5c59e1fa058467f64034f8974e0e (patch)
treee91838195760216d9b3c0dda5931d3d88aa53cf6 /lib/PublicInbox/WWW.pm
parent4c808e262750b717e27e050cecaed0a44e780aa6 (diff)
downloadpublic-inbox-d39a8a440c9b5c59e1fa058467f64034f8974e0e.tar.gz
This is enabled by default, for now.
Smart HTTP cloning support will be added later, but it will
be optional since it can be highly CPU and memory intensive.
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r--lib/PublicInbox/WWW.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm
index d5635d84..1c6936f7 100644
--- a/lib/PublicInbox/WWW.pm
+++ b/lib/PublicInbox/WWW.pm
@@ -18,6 +18,7 @@ use URI::Escape qw(uri_escape_utf8 uri_unescape);
 use constant SSOMA_URL => 'http://ssoma.public-inbox.org/';
 use constant PI_URL => 'http://public-inbox.org/';
 require PublicInbox::Git;
+use PublicInbox::GitHTTPDumb;
 our $LISTNAME_RE = qr!\A/([\w\.\-]+)!;
 our $MID_RE = qr!([^/]+)!;
 our $END_RE = qr!(f/|T/|t/|t\.mbox(?:\.gz)?|t\.atom|raw|)!;
@@ -42,6 +43,10 @@ sub run {
         } elsif ($path_info =~ m!$LISTNAME_RE/(?:atom\.xml|new\.atom)\z!o) {
                 invalid_list($ctx, $1) || get_atom($ctx);
 
+        } elsif ($path_info =~ m!$LISTNAME_RE/
+                                ($PublicInbox::GitHTTPDumb::ANY)\z!ox) {
+                my $path = $2;
+                invalid_list($ctx, $1) || serve_git($cgi, $ctx->{git}, $path);
         } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/$END_RE\z!o) {
                 msg_page($ctx, $1, $2, $3);
 
@@ -395,4 +400,9 @@ sub msg_page {
         r404($ctx);
 }
 
+sub serve_git {
+        my ($cgi, $git, $path) = @_;
+        PublicInbox::GitHTTPDumb::serve($cgi, $git, $path);
+}
+
 1;