about summary refs log tree commit homepage
path: root/examples/public-inbox.psgi
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-07-01 02:09:45 +0000
committerEric Wong <e@80x24.org>2016-07-01 02:14:10 +0000
commit52052329acedddc0082487283a5a0390a8c86602 (patch)
treea8da1e82f2f54a69813c252d9fe90564133945e3 /examples/public-inbox.psgi
parent79bf257cbc4e188992f540d6b4ae1bd5cbcf26ee (diff)
downloadpublic-inbox-52052329acedddc0082487283a5a0390a8c86602.tar.gz
This means we can still show non-git users a somewhat browseable
URL with a link to the README.html file while allowing git users
to type less when cloning.

All of the following are supported:

git clone https://public-inbox.org/ public-inbox
git clone https://public-inbox.org/public-inbox
git clone https://public-inbox.org/public-inbox.git
torsocks git clone http://ou63pmih66umazou.onion/public-inbox
Diffstat (limited to 'examples/public-inbox.psgi')
-rw-r--r--examples/public-inbox.psgi4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi
index a90a2bc3..11e2a6e7 100644
--- a/examples/public-inbox.psgi
+++ b/examples/public-inbox.psgi
@@ -47,7 +47,9 @@ builder {
         sub {
                 my ($env) = @_;
                 # share public-inbox.git code!
-                if ($src && $env->{PATH_INFO} =~ m!\A/public-inbox\.git/(.*)!) {
+                if ($src && $env->{PATH_INFO} =~
+                                m!\A/(?:public-inbox(?:\.git)?/)?
+                                ($PublicInbox::GitHTTPBackend::ANY)\z!xo) {
                         PublicInbox::GitHTTPBackend::serve($env, $src, $1);
                 } else {
                         $www->call($env);