Skip to content

Commit

Permalink
Merge pull request #239 from ArFe/bug-fix-swagger-middleware-dropping…
Browse files Browse the repository at this point in the history
…-trailing-slash-not-finding-path

Apply path.Join to the incoming URL
  • Loading branch information
casualjim committed Apr 28, 2022
2 parents a820773 + 1d624ea commit 219a745
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 219a745

Please sign in to comment.