From: Ardis Lu Date: Tue, 28 Jul 2026 06:05:22 +0000 (-0700) Subject: Make regex more explicit X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=58ecd3584923b0a678923226e39be6eeaa51bc43;p=git.ardis.lu Make regex more explicit Discarding the other capture groups makes the intent clearer. --- 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