Browse Source

Add secure/httpOnly attributes to the lang cookie (#14279) (#14280)

* Add secure/httpOnly attributes to the lang cookie (#9690) (#14279)

* apply to InitLocales() too

Co-authored-by: Timo Gurr <timo.gurr@gmail.com>
tags/v1.13.2
6543 5 years ago committed by GitHub
parent
commit
fb656b5124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      routers/init.go
  2. 2
      routers/routes/routes.go

2
routers/init.go

@ -116,6 +116,8 @@ func InitLocales() {
Names: setting.Names,
DefaultLang: "en-US",
Redirect: false,
CookieHttpOnly: true,
Secure: setting.SessionConfig.Secure,
CookieDomain: setting.SessionConfig.Domain,
})
}

2
routers/routes/routes.go

@ -253,6 +253,8 @@ func NewMacaron() *macaron.Macaron {
Names: setting.Names,
DefaultLang: "en-US",
Redirect: false,
CookieHttpOnly: true,
Secure: setting.SessionConfig.Secure,
CookieDomain: setting.SessionConfig.Domain,
}))
m.Use(cache.Cacher(cache.Options{

Loading…
Cancel
Save