fix: do not log error for backend logout 204 (#3381)

* Don't log error for backend logout 204

Signed-off-by: artificiosus <artificiosus@users.noreply.github.com>

* doc: add changelog entry for #3381

Signed-off-by: Jan Larwig <jan@larwig.com>

* refactor: use http.StatusOK and http.StatusNoContent instead of integers

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: artificiosus <artificiosus@users.noreply.github.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
artificiosus 2026-03-23 05:27:49 -04:00 committed by GitHub
parent a4d89036ec
commit 44236f0314
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@
- [#3382](https://github.com/oauth2-proxy/oauth2-proxy/pull/3382) chore(deps): update gomod and golangci/golangci-lint to v2.11.4 (@tuunit)
- [#3374](https://github.com/oauth2-proxy/oauth2-proxy/pull/3374) fix: handle Unix socket RemoteAddr in IP resolution (@H1net)
- [#3381](https://github.com/oauth2-proxy/oauth2-proxy/pull/3381) fix: do not log error for backend logout 204 (@artificiosus)
## Release Highlights

View File

@ -798,7 +798,7 @@ func (p *OAuthProxy) backendLogout(rw http.ResponseWriter, req *http.Request) {
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent {
logger.Errorf("error while calling backend logout url, returned error code %v", resp.StatusCode)
}
}