1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-10-18 15:44:21 +00:00

Fix: Memory leak due to http requests stored forever

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-09-08 19:39:59 +02:00
parent b59fefb0e3
commit e6952ed1b0
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -10,6 +10,7 @@ import (
"github.com/Luzifer/rconfig" "github.com/Luzifer/rconfig"
"github.com/flosch/pongo2" "github.com/flosch/pongo2"
"github.com/gorilla/context"
"github.com/gorilla/sessions" "github.com/gorilla/sessions"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
yaml "gopkg.in/yaml.v2" yaml "gopkg.in/yaml.v2"
@ -102,7 +103,7 @@ func main() {
http.HandleFunc("/login", handleLoginRequest) http.HandleFunc("/login", handleLoginRequest)
http.HandleFunc("/logout", handleLogoutRequest) http.HandleFunc("/logout", handleLogoutRequest)
http.ListenAndServe(fmt.Sprintf("%s:%d", mainCfg.Listen.Addr, mainCfg.Listen.Port), nil) http.ListenAndServe(fmt.Sprintf("%s:%d", mainCfg.Listen.Addr, mainCfg.Listen.Port), context.ClearHandler(http.DefaultServeMux))
} }
func handleAuthRequest(res http.ResponseWriter, r *http.Request) { func handleAuthRequest(res http.ResponseWriter, r *http.Request) {