mirror of https://github.com/gophish/gophish
Set StrictSlash on API router to automatically redirect to correct url if slash is not provided
parent
af35130222
commit
ef371f68bd
|
@ -30,6 +30,7 @@ func CreateRouter() *nosurf.CSRFHandler {
|
||||||
|
|
||||||
// Create the API routes
|
// Create the API routes
|
||||||
api := router.PathPrefix("/api").Subrouter()
|
api := router.PathPrefix("/api").Subrouter()
|
||||||
|
api = api.StrictSlash(true)
|
||||||
api.HandleFunc("/", Use(API, mid.RequireLogin))
|
api.HandleFunc("/", Use(API, mid.RequireLogin))
|
||||||
api.HandleFunc("/reset", Use(API_Reset, mid.RequireLogin))
|
api.HandleFunc("/reset", Use(API_Reset, mid.RequireLogin))
|
||||||
api.HandleFunc("/campaigns/", Use(API_Campaigns, mid.RequireAPIKey))
|
api.HandleFunc("/campaigns/", Use(API_Campaigns, mid.RequireAPIKey))
|
||||||
|
|
Loading…
Reference in New Issue