From f4f241b23d8bc4892d5e56b3bf3d607fc39d1923 Mon Sep 17 00:00:00 2001 From: n0vad3v Date: Tue, 23 Apr 2024 13:05:14 +0800 Subject: [PATCH] Use prefix to check invalid Path --- handler/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler/router.go b/handler/router.go index afcc327d..30f7d91f 100644 --- a/handler/router.go +++ b/handler/router.go @@ -23,7 +23,7 @@ func Convert(c *fiber.Ctx) error { // 3. pass it to encoder, get the result, send it back // normal http request will start with / - if strings.HasPrefix(c.Path(), ".") || strings.HasPrefix(c.Path(), "%2e") { + if !strings.HasPrefix(c.Path(), "/") { _ = c.SendStatus(http.StatusBadRequest) return nil }