diff options
author | Tamal Saha <tamal@appscode.com> | 2019-07-12 06:57:31 -0700 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-07-12 09:57:31 -0400 |
commit | 2102f9d92db308f694707ebe6253beb20c5f7505 (patch) | |
tree | 2a09910b2fb4b3b4c151966c3a7620f48a566633 /routers/routes | |
parent | d95237b56199934418816aaef4881ca538637c05 (diff) | |
download | gitea-2102f9d92db308f694707ebe6253beb20c5f7505.tar.gz gitea-2102f9d92db308f694707ebe6253beb20c5f7505.zip |
Support setting cookie domain (#6288)
Signed-off-by: Tamal Saha <tamal@appscode.com>
Diffstat (limited to 'routers/routes')
-rw-r--r-- | routers/routes/routes.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go index ec57e8f5fd..c81d56064c 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -181,12 +181,13 @@ func NewMacaron() *macaron.Macaron { } m.Use(i18n.I18n(i18n.Options{ - SubURL: setting.AppSubURL, - Files: localFiles, - Langs: setting.Langs, - Names: setting.Names, - DefaultLang: "en-US", - Redirect: false, + SubURL: setting.AppSubURL, + Files: localFiles, + Langs: setting.Langs, + Names: setting.Names, + DefaultLang: "en-US", + Redirect: false, + CookieDomain: setting.SessionConfig.Domain, })) m.Use(cache.Cacher(cache.Options{ Adapter: setting.CacheService.Adapter, @@ -202,8 +203,9 @@ func NewMacaron() *macaron.Macaron { Cookie: setting.CSRFCookieName, SetCookie: true, Secure: setting.SessionConfig.Secure, - CookieHttpOnly: true, + CookieHttpOnly: setting.CSRFCookieHTTPOnly, Header: "X-Csrf-Token", + CookieDomain: setting.SessionConfig.Domain, CookiePath: setting.AppSubURL, })) m.Use(toolbox.Toolboxer(m, toolbox.Options{ |