From 58ecd3584923b0a678923226e39be6eeaa51bc43 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Mon, 27 Jul 2026 23:05:22 -0700 Subject: [PATCH] Make regex more explicit Discarding the other capture groups makes the intent clearer. --- etc/caddy/Caddyfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/caddy/Caddyfile b/etc/caddy/Caddyfile index cb4fc06..d98566f 100644 --- a/etc/caddy/Caddyfile +++ b/etc/caddy/Caddyfile @@ -19,8 +19,8 @@ git.ardis.lu { } # For /[name] and /[name].git WITHOUT additional paths, redirect to /?p=[name] for human-friendly browsing - @git_bare path_regexp ^(\/)([A-Za-z0-9_.-]+?)(\.git)?$ - redir @git_bare /?p={re.2} + @git_bare path_regexp ^\/([A-Za-z0-9_.-]+?)(?:\.git)?$ + redir @git_bare /?p={re.1} # For /[name].git WITH additional paths, serve git-http-backend to support git operations # {method}, {path}, {query} are magic Caddy variables which correspond to the URL -- 2.47.3