Skip to content

Commit

Permalink
Use RedirectSlashes middleware by default Goa mux
Browse files Browse the repository at this point in the history
  • Loading branch information
tchssk committed Sep 26, 2023
1 parent ab57d85 commit 2a1790d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions http/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"regexp"

chi "github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
)

type (
Expand Down Expand Up @@ -85,6 +86,7 @@ func NewMuxer() ResolverMuxer {
w.WriteHeader(http.StatusNotFound)
enc.Encode(NewErrorResponse(ctx, fmt.Errorf("404 page not found"))) // nolint:errcheck
}))
r.Use(middleware.RedirectSlashes)
return &mux{Router: r, wildcards: make(map[string]string)}
}

Expand Down

0 comments on commit 2a1790d

Please sign in to comment.