back to "old" way to parse url because it dont work with more than 2 "/"
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user