From 1d624ea4ba125f3d0ebaddaf56811f55aec12e24 Mon Sep 17 00:00:00 2001 From: ArFe Date: Fri, 22 Apr 2022 16:59:01 -0400 Subject: [PATCH] Apply path.Join to the incoming URL Compare apples to apples by applying path.Join to the incoming URL, as it happens to the internal path. Signed-off-by: Ariel Ferreira --- middleware/swaggerui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/swaggerui.go b/middleware/swaggerui.go index 2c92f5c9..bab523c5 100644 --- a/middleware/swaggerui.go +++ b/middleware/swaggerui.go @@ -73,7 +73,7 @@ func SwaggerUI(opts SwaggerUIOpts, next http.Handler) http.Handler { b := buf.Bytes() return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { + if path.Join(r.URL.Path) == pth { rw.Header().Set("Content-Type", "text/html; charset=utf-8") rw.WriteHeader(http.StatusOK)