From 8bb61616ba39d821dd6b299c8c6d9cae0b0e15d8 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Tue, 24 Oct 2023 17:20:57 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20lecture=20de=20document=20avec=20caract?= =?UTF-8?q?=C3=A8res=20sp=C3=A9ciaux=20dans=20le=20titre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_handlers/web_handlers.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web_handlers/web_handlers.go b/web_handlers/web_handlers.go index 6038ce9..da02d10 100644 --- a/web_handlers/web_handlers.go +++ b/web_handlers/web_handlers.go @@ -4,6 +4,7 @@ import ( "fmt" "io" "net/http" + "net/url" "sort" "git.agecem.com/agecem/agecem-org/api" @@ -98,7 +99,12 @@ func (h *WebHandler) HandlePublicDocumentation(c echo.Context) error { bucket := c.Param("bucket") document := c.Param("document") - response, err := h.ApiClient.Voki.Call(http.MethodGet, fmt.Sprintf("/v1/bucket/%s/%s", bucket, document), nil, true) + unescaped, err := url.QueryUnescape(fmt.Sprintf("/v1/bucket/%s/%s", bucket, document)) + if err != nil { + return c.JSON(http.StatusBadRequest, map[string]string{"message": "Bad Request"}) + } + + response, err := h.ApiClient.Voki.Call(http.MethodGet, unescaped, nil, true) if err != nil { return c.JSON(models.NotFoundResponse()) }