Skip to content

Commit

Permalink
Apply path.Join to the incoming URL
Browse files Browse the repository at this point in the history
Compare apples to apples by applying path.Join to the incoming URL, as it happens to the internal path.

Signed-off-by: Ariel Ferreira <aferreira@bannerengineering.com>
  • Loading branch information
ArFe committed Apr 22, 2022
1 parent 6a17228 commit 1d624ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware/swaggerui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 1d624ea

Please sign in to comment.