Fix endpoint variable being changed by range
This commit is contained in:
parent
a62611c6fa
commit
4adf0ce931
@ -45,8 +45,9 @@ func main() {
|
|||||||
|
|
||||||
gob.Register(uuid.UUID{})
|
gob.Register(uuid.UUID{})
|
||||||
for _, v := range modules {
|
for _, v := range modules {
|
||||||
router.HandleFunc(v.GetEndpoint(), func(rw http.ResponseWriter, req *http.Request) {
|
a := v.GetEndpoint()
|
||||||
http.Redirect(rw, req, v.GetEndpoint()+"/", http.StatusTemporaryRedirect)
|
router.HandleFunc(a, func(rw http.ResponseWriter, req *http.Request) {
|
||||||
|
http.Redirect(rw, req, a+"/", http.StatusTemporaryRedirect)
|
||||||
})
|
})
|
||||||
v.SetupModule(router.PathPrefix(v.GetEndpoint()).Subrouter(), stateManager.sessionWrapper)
|
v.SetupModule(router.PathPrefix(v.GetEndpoint()).Subrouter(), stateManager.sessionWrapper)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user