mirror of
https://github.com/Luzifer/nginx-sso.git
synced 2024-12-20 12:51:17 +00:00
Fix: Memory leak due to http requests stored forever
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
b59fefb0e3
commit
e6952ed1b0
1 changed files with 2 additions and 1 deletions
3
main.go
3
main.go
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue