Added Insecure HTTP Mode

This commit is contained in:
Tim Schuster committed 2017-03-16 20:08:15 +01:00
1 parent e85636f4b9
commit 53039e6102
3 files changed
+8 -11

No files matched your search

+6 -2
View File
@@ -2,12 +2,16 @@ package middle
import (
"github.com/icza/session"
"go.rls.moe/nyx/config"
"net/http"
)
func init() {
func SetupSessionManager(c *config.Config) {
session.Global.Close()
session.Global = session.NewCookieManager(session.NewInMemStore())
session.Global = session.NewCookieManagerOptions(session.NewInMemStore(),
&session.CookieMngrOptions{
AllowHTTP: c.DisableSecurity,
})
}
func GetSession(r *http.Request) session.Session {