git.iko.soy/typeable/oauth2-proxy
on master help sign in
Merge pull request #742 from oauth2-proxy/domain-log

Only log no cookie match if cookie domains specified

commit4134a9010ef60935782ca31e44e83cebbadf8e46 authorJoel Speed <Joel.speed@hotmail.co.uk> dateThu 27 Aug 2020, 15:01 (6 years ago) parentd7abd56105d5ac
2 files changed+2−1
CHANGELOG.md+1 pkg/cookies/cookies.go+1−1
CHANGELOG.md+1
@@ -11,6 +11,7 @@
1111
1212## Changes since v6.0.0
1313
14+- [#742](https://github.com/oauth2-proxy/oauth2-proxy/pull/742) Only log no cookie match if cookie domains specified (@JoelSpeed)
1415- [#562](https://github.com/oauth2-proxy/oauth2-proxy/pull/562) Create generic Authorization Header constructor (@JoelSpeed)
1516- [#715](https://github.com/oauth2-proxy/oauth2-proxy/pull/715) Ensure session times are not nil before printing them (@JoelSpeed)
1617- [#714](https://github.com/oauth2-proxy/oauth2-proxy/pull/714) Support passwords with Redis session stores (@NickMeves)
pkg/cookies/cookies.go+1−1
@@ -45,9 +45,9 @@ func MakeCookieFromOptions(req *http.Request, name string, value string, cookieO
4545 return MakeCookie(req, name, value, cookieOpts.Path, domain, cookieOpts.HTTPOnly, cookieOpts.Secure, expiration, now, ParseSameSite(cookieOpts.SameSite))
4646 }
4747 // If nothing matches, create the cookie with the shortest domain
48− logger.Errorf("Warning: request host %q did not match any of the specific cookie domains of %q", GetRequestHost(req), strings.Join(cookieOpts.Domains, ","))
4948 defaultDomain := ""
5049 if len(cookieOpts.Domains) > 0 {
50+ logger.Errorf("Warning: request host %q did not match any of the specific cookie domains of %q", GetRequestHost(req), strings.Join(cookieOpts.Domains, ","))
5151 defaultDomain = cookieOpts.Domains[len(cookieOpts.Domains)-1]
5252 }
5353 return MakeCookie(req, name, value, cookieOpts.Path, defaultDomain, cookieOpts.HTTPOnly, cookieOpts.Secure, expiration, now, ParseSameSite(cookieOpts.SameSite))