internal: add tests with querystring

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-03-07 22:03:36 +01:00
parent 73b2e2cb82
commit 76660e4666
2 changed files with 4 additions and 4 deletions

View File

@ -24,12 +24,12 @@ func TestCheckRedirectParam(t *testing.T) {
assert.Equal(t, false, ok) assert.Equal(t, false, ok)
assert.Equal(t, "", rd) assert.Equal(t, "", rd)
req, _ = http.NewRequest("GET", "/outpost.goauthentik.io/auth/start?rd=https://ext.t.goauthentik.io/test", nil) req, _ = http.NewRequest("GET", "/outpost.goauthentik.io/auth/start?rd=https://ext.t.goauthentik.io/test?foo", nil)
rd, ok = a.checkRedirectParam(req) rd, ok = a.checkRedirectParam(req)
assert.Equal(t, true, ok) assert.Equal(t, true, ok)
assert.Equal(t, "https://ext.t.goauthentik.io/test", rd) assert.Equal(t, "https://ext.t.goauthentik.io/test?foo", rd)
} }
func TestCheckRedirectParam_Domain(t *testing.T) { func TestCheckRedirectParam_Domain(t *testing.T) {

View File

@ -28,7 +28,7 @@ func (a *Application) getStore(p api.ProxyOutpostConfig) sessions.Store {
rs.SetMaxAge(0) rs.SetMaxAge(0)
} }
rs.Options.Domain = *p.CookieDomain rs.Options.Domain = *p.CookieDomain
a.log.Info("using redis session backend") a.log.Debug("using redis session backend")
store = rs store = rs
} else { } else {
dir := os.TempDir() dir := os.TempDir()
@ -48,7 +48,7 @@ func (a *Application) getStore(p api.ProxyOutpostConfig) sessions.Store {
cs.MaxAge(0) cs.MaxAge(0)
} }
cs.Options.Domain = *p.CookieDomain cs.Options.Domain = *p.CookieDomain
a.log.WithField("dir", dir).Info("using filesystem session backend") a.log.WithField("dir", dir).Debug("using filesystem session backend")
store = cs store = cs
} }
return store return store