Use strict slash
This commit is contained in:
parent
78625f6836
commit
1536bc9649
1 changed files with 3 additions and 3 deletions
6
main.go
6
main.go
|
@ -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("").
|
||||||
|
|
Loading…
Reference in a new issue