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) logger := log.New(os.Stdout, "", log.Ldate|log.Ltime)
r := mux.NewRouter() r := mux.NewRouter().StrictSlash(true)
r. r.
Methods(http.MethodGet). Methods(http.MethodGet).
Path("/"). Path("/").
@ -50,9 +50,9 @@ func main() {
logging.Handler(logger), 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. br.
Methods(http.MethodPost). Methods(http.MethodPost).
Path(""). Path("").