From 633b84009c4d02459e2f68da56a83e06ecfbc408 Mon Sep 17 00:00:00 2001 From: Lei Xue Date: Sat, 14 Mar 2026 18:51:01 +0800 Subject: [PATCH] fix versionMatcher: use non-capturing group (?:-dirty)? for gorilla/mux gorilla/mux explicitly rejects capturing groups () in route regexps, only non-capturing groups (?:) are allowed. The original regex was missing the ? to make -dirty optional. Co-Authored-By: Claude Opus 4.6 (1M context) --- pkg/apiserver/apiserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index eb40477..9a94cfd 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -40,7 +40,7 @@ import ( // versionMatcher defines a variable matcher to be parsed by the router // when a request is about to be served. -const versionMatcher = "/v{version:[0-9.]+(-dirty)?}" +const versionMatcher = "/v{version:[0-9.]+(?:-dirty)?}" // Config provides the configuration for the API server type Config struct {