From 91d4336e475b98b7463dbb36f1283cfe497034fb Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 17 Feb 2022 17:02:02 +0000 Subject: [PATCH] Rename path variable to fix key backup tests --- clientapi/routing/routing.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index cf33935fb..40ce6f1de 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -122,7 +122,8 @@ func Setup( // (r0|v3) - BUT this is a captured group, which makes no sense because you cannot extract this group // from a match (gorilla/mux exposes no way to do this) so it demands you make it a non-capturing group // using ?: so the final regexp becomes what is below. We also need a trailing slash to stop 'v33333' matching. - v3mux := publicAPIMux.PathPrefix("/{version:(?:r0|v3)}/").Subrouter() + // Note that 'apiversion' is chosen because it must not collide with a variable used in any of the routing! + v3mux := publicAPIMux.PathPrefix("/{apiversion:(?:r0|v3)}/").Subrouter() unstableMux := publicAPIMux.PathPrefix("/unstable").Subrouter()