From 0b2d1265cb663aa8ef2e5bbb3660d1db2c64fb0f Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Sat, 26 Oct 2019 22:28:17 +0300 Subject: [PATCH] gitweb: fix links that end with /HEAD On the Gitweb site, links that end with /HEAD (for example menu links after selecting 'tree' on the front page) are mistakenly redirected to the git-http-backend cgi script and an empty page is shown to the user. Modified Apache2 ScriptAliasMatch regex so that git-http-backend services get redirected only if they immediately follow repository's name path component. Links on Gitweb site have additional action component before /HEAD and those will be handled by the gitweb cgi script. The relevant git-http-backend source: https://repo.or.cz/git/debian.git/blob/refs/tags/v2.20.1:/http-backend.c#l706 Signed-off-by: Veiko Aasa Reviewed-by: Sunil Mohan Adapa --- .../data/etc/apache2/conf-available/gitweb-freedombox.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plinth/modules/gitweb/data/etc/apache2/conf-available/gitweb-freedombox.conf b/plinth/modules/gitweb/data/etc/apache2/conf-available/gitweb-freedombox.conf index 16e1d6936..21bdd2469 100644 --- a/plinth/modules/gitweb/data/etc/apache2/conf-available/gitweb-freedombox.conf +++ b/plinth/modules/gitweb/data/etc/apache2/conf-available/gitweb-freedombox.conf @@ -10,7 +10,7 @@ # All git operations are handled by git-http-backend CGI script. Rest of the # HTTP requests (say sent by the browser) are handled by gitweb. ScriptAliasMatch \ - "(?x)^/gitweb/(.*/(HEAD | \ + "(?x)^/gitweb/([^/]+/(HEAD | \ info/refs | \ objects/(info/[^/]+ | \ [0-9a-f]{2}/[0-9a-f]{38} | \