From 0600f7972a254a157a31b8099b2879b0f35a4a50 Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 1 Jun 2021 02:33:22 +0100 Subject: [PATCH] Add missing SameSite settings for the i_like_gitea cookie (#16037) (#16039) Backport #16037 The i_like_gitea cookie appears to be missing the SameSite settings. I think they were present at some point but may have been removed in a merge. This PR ensures that they are set. Fix #15972 Signed-off-by: Andrew Thornton --- routers/api/v1/api.go | 1 + routers/routes/install.go | 1 + routers/routes/web.go | 1 + 3 files changed, 3 insertions(+) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 7beaf96020..9fed221136 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -557,6 +557,7 @@ func Routes() *web.Route { Gclifetime: setting.SessionConfig.Gclifetime, Maxlifetime: setting.SessionConfig.Maxlifetime, Secure: setting.SessionConfig.Secure, + SameSite: setting.SessionConfig.SameSite, Domain: setting.SessionConfig.Domain, })) m.Use(securityHeaders()) diff --git a/routers/routes/install.go b/routers/routes/install.go index fea396bc26..22c9d5febb 100644 --- a/routers/routes/install.go +++ b/routers/routes/install.go @@ -89,6 +89,7 @@ func InstallRoutes() *web.Route { Gclifetime: setting.SessionConfig.Gclifetime, Maxlifetime: setting.SessionConfig.Maxlifetime, Secure: setting.SessionConfig.Secure, + SameSite: setting.SessionConfig.SameSite, Domain: setting.SessionConfig.Domain, })) diff --git a/routers/routes/web.go b/routers/routes/web.go index 9910249d7b..39d2d7bef4 100644 --- a/routers/routes/web.go +++ b/routers/routes/web.go @@ -135,6 +135,7 @@ func WebRoutes() *web.Route { Gclifetime: setting.SessionConfig.Gclifetime, Maxlifetime: setting.SessionConfig.Maxlifetime, Secure: setting.SessionConfig.Secure, + SameSite: setting.SessionConfig.SameSite, Domain: setting.SessionConfig.Domain, }))