use modern way to parse URL

This commit is contained in:
2025-12-17 14:10:40 +02:00
parent ffec908ca4
commit 441253351d

View File

@@ -44,7 +44,7 @@ func (h *blockHandler) handleBlock(w http.ResponseWriter, r *http.Request) {
return
}
blockPath := r.URL.Path[len("/api/block/"):]
blockPath := chi.URLParam(r, "blockPath")
block, err := LoadBlock(blockPath, h.cfg)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)