Only log no cookie match if cookie domains specified
This commit is contained in:
		
							parent
							
								
									d7abd56981
								
							
						
					
					
						commit
						105d5acb7b
					
				|  | @ -11,6 +11,7 @@ | ||||||
| 
 | 
 | ||||||
| ## Changes since v6.0.0 | ## Changes since v6.0.0 | ||||||
| 
 | 
 | ||||||
|  | - [#742](https://github.com/oauth2-proxy/oauth2-proxy/pull/742) Only log no cookie match if cookie domains specified (@JoelSpeed) | ||||||
| - [#562](https://github.com/oauth2-proxy/oauth2-proxy/pull/562) Create generic Authorization Header constructor (@JoelSpeed) | - [#562](https://github.com/oauth2-proxy/oauth2-proxy/pull/562) Create generic Authorization Header constructor (@JoelSpeed) | ||||||
| - [#715](https://github.com/oauth2-proxy/oauth2-proxy/pull/715) Ensure session times are not nil before printing them (@JoelSpeed) | - [#715](https://github.com/oauth2-proxy/oauth2-proxy/pull/715) Ensure session times are not nil before printing them (@JoelSpeed) | ||||||
| - [#714](https://github.com/oauth2-proxy/oauth2-proxy/pull/714) Support passwords with Redis session stores (@NickMeves) | - [#714](https://github.com/oauth2-proxy/oauth2-proxy/pull/714) Support passwords with Redis session stores (@NickMeves) | ||||||
|  |  | ||||||
|  | @ -45,9 +45,9 @@ func MakeCookieFromOptions(req *http.Request, name string, value string, cookieO | ||||||
| 		return MakeCookie(req, name, value, cookieOpts.Path, domain, cookieOpts.HTTPOnly, cookieOpts.Secure, expiration, now, ParseSameSite(cookieOpts.SameSite)) | 		return MakeCookie(req, name, value, cookieOpts.Path, domain, cookieOpts.HTTPOnly, cookieOpts.Secure, expiration, now, ParseSameSite(cookieOpts.SameSite)) | ||||||
| 	} | 	} | ||||||
| 	// If nothing matches, create the cookie with the shortest domain
 | 	// If nothing matches, create the cookie with the shortest domain
 | ||||||
| 	logger.Errorf("Warning: request host %q did not match any of the specific cookie domains of %q", GetRequestHost(req), strings.Join(cookieOpts.Domains, ",")) |  | ||||||
| 	defaultDomain := "" | 	defaultDomain := "" | ||||||
| 	if len(cookieOpts.Domains) > 0 { | 	if len(cookieOpts.Domains) > 0 { | ||||||
|  | 		logger.Errorf("Warning: request host %q did not match any of the specific cookie domains of %q", GetRequestHost(req), strings.Join(cookieOpts.Domains, ",")) | ||||||
| 		defaultDomain = cookieOpts.Domains[len(cookieOpts.Domains)-1] | 		defaultDomain = cookieOpts.Domains[len(cookieOpts.Domains)-1] | ||||||
| 	} | 	} | ||||||
| 	return MakeCookie(req, name, value, cookieOpts.Path, defaultDomain, cookieOpts.HTTPOnly, cookieOpts.Secure, expiration, now, ParseSameSite(cookieOpts.SameSite)) | 	return MakeCookie(req, name, value, cookieOpts.Path, defaultDomain, cookieOpts.HTTPOnly, cookieOpts.Secure, expiration, now, ParseSameSite(cookieOpts.SameSite)) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue