From 7dd6bccc9668f5c863f51548cf69cf7a4604e661 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Fri, 20 Mar 2026 01:34:20 +0900 Subject: [PATCH] knotserver: use correct context key Signed-off-by: Seongmin Lee --- knotserver/router.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/knotserver/router.go b/knotserver/router.go index d290def4..40ceff3e 100644 --- a/knotserver/router.go +++ b/knotserver/router.go @@ -83,8 +83,9 @@ func (h *Knot) Router() http.Handler { r.Route("/{did}", func(r chi.Router) { r.Use(h.resolveDidRedirect) - r.Use(h.resolveRepo) r.Route("/{name}", func(r chi.Router) { + r.Use(h.resolveRepo) + // routes for git operations r.Get("/info/refs", h.InfoRefs) r.Post("/git-upload-archive", h.UploadArchive) @@ -176,7 +177,7 @@ func (h *Knot) resolveRepo(next http.Handler) http.Handler { return } - ctx := context.WithValue(r.Context(), "repoPath", repoPath) + ctx := context.WithValue(r.Context(), ctxRepoPathKey{}, repoPath) next.ServeHTTP(w, r.WithContext(ctx)) }) } -- 2.51.2