mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-10-20 17:51:37 +02:00
Allow multiple cookie domains to be specified (#412)
* Allow multiple cookie domains to be specified * Use X-Forwarded-Host, if it exists, when selecting cookie domain * Perform cookie domain sorting in config validation phase * Extract get domain cookies to a single function * Update pkg/cookies/cookies.go Co-Authored-By: Joel Speed <Joel.speed@hotmail.co.uk> * Update changelog Co-authored-by: Marcos Lilljedahl <marcosnils@gmail.com> Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
This commit is contained in:
co-authored by
Joel Speed
Marcos Lilljedahl
parent
7f72a22227
commit
a659b9558e
@@ -63,7 +63,11 @@ var _ = Describe("NewSessionStore", func() {
|
||||
|
||||
It("have the correct domain set", func() {
|
||||
for _, cookie := range cookies {
|
||||
Expect(cookie.Domain).To(Equal(cookieOpts.CookieDomain))
|
||||
specifiedDomain := ""
|
||||
if len(cookieOpts.CookieDomains) > 0 {
|
||||
specifiedDomain = cookieOpts.CookieDomains[0]
|
||||
}
|
||||
Expect(cookie.Domain).To(Equal(specifiedDomain))
|
||||
}
|
||||
})
|
||||
|
||||
@@ -343,7 +347,7 @@ var _ = Describe("NewSessionStore", func() {
|
||||
CookieRefresh: time.Duration(2) * time.Hour,
|
||||
CookieSecure: false,
|
||||
CookieHTTPOnly: false,
|
||||
CookieDomain: "example.com",
|
||||
CookieDomains: []string{"example.com"},
|
||||
CookieSameSite: "strict",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user