0
0
mirror of https://github.com/rls-moe/nyx synced 2025-08-19 06:18:38 +00:00

Added Insecure HTTP Mode

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

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 {