Use strict slash

This commit is contained in:
Lena Fuhrimann 2017-05-03 10:23:46 +02:00
parent 78625f6836
commit 1536bc9649

View file

@ -27,7 +27,7 @@ func main() {
logger := log.New(os.Stdout, "", log.Ldate|log.Ltime)
r := mux.NewRouter()
r := mux.NewRouter().StrictSlash(true)
r.
Methods(http.MethodGet).
Path("/").
@ -50,9 +50,9 @@ func main() {
logging.Handler(logger),
))
api := r.PathPrefix("/api").Subrouter()
api := r.PathPrefix("/api").Subrouter().StrictSlash(true)
br := api.PathPrefix("/buckets").Subrouter()
br := api.PathPrefix("/buckets").Subrouter().StrictSlash(true)
br.
Methods(http.MethodPost).
Path("").