From b92682177c6b70b6a1517252713c9e2f494afba3 Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 17 Dec 2025 14:22:40 +0200 Subject: [PATCH] back to "old" way to parse url because it dont work with more than 2 "/" --- api/block/handle.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/block/handle.go b/api/block/handle.go index 67bfcf5..f1bc517 100644 --- a/api/block/handle.go +++ b/api/block/handle.go @@ -34,7 +34,7 @@ func Route(config *config.Config) func(chi.Router) { cfg: config, } return func(r chi.Router) { - r.Get("/{blockPath}", h.handleBlock) + r.Get("/*", h.handleBlock) } } @@ -44,7 +44,7 @@ func (h *blockHandler) handleBlock(w http.ResponseWriter, r *http.Request) { return } - blockPath := chi.URLParam(r, "blockPath") + blockPath := r.URL.Path[len("/api/block/"):] block, err := LoadBlock(blockPath, h.cfg) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError)