internal: set SameSite for outpost

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-05-21 13:21:45 +02:00
parent be26b92927
commit 7e95c756b9
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package application
import ( import (
"fmt" "fmt"
"math" "math"
"net/http"
"net/url" "net/url"
"os" "os"
"strconv" "strconv"
@ -30,6 +31,7 @@ func (a *Application) getStore(p api.ProxyOutpostConfig, externalHost *url.URL)
} }
rs.Options.Path = externalHost.Path rs.Options.Path = externalHost.Path
rs.Options.Domain = *p.CookieDomain rs.Options.Domain = *p.CookieDomain
rs.Options.SameSite = http.SameSiteNoneMode
a.log.Trace("using redis session backend") a.log.Trace("using redis session backend")
store = rs store = rs
} else { } else {
@ -51,6 +53,7 @@ func (a *Application) getStore(p api.ProxyOutpostConfig, externalHost *url.URL)
} }
cs.Options.Path = externalHost.Path cs.Options.Path = externalHost.Path
cs.Options.Domain = *p.CookieDomain cs.Options.Domain = *p.CookieDomain
cs.Options.SameSite = http.SameSiteNoneMode
a.log.WithField("dir", dir).Trace("using filesystem session backend") a.log.WithField("dir", dir).Trace("using filesystem session backend")
store = cs store = cs
} }