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>
commit44236f0314ebaeed8d9f57ece7e2ab05a80b81e6
authorartificiosus <artificiosus@users.noreply.github.com>
dateMon 23 Mar 2026, 05:27 (6 months ago)
parenta4d8903
CHANGELOG.md+1
@@ -15,6 +15,7 @@
1515
1616- [#3382](https://github.com/oauth2-proxy/oauth2-proxy/pull/3382) chore(deps): update gomod and golangci/golangci-lint to v2.11.4 (@tuunit)
1717- [#3374](https://github.com/oauth2-proxy/oauth2-proxy/pull/3374) fix: handle Unix socket RemoteAddr in IP resolution (@H1net)
18+- [#3381](https://github.com/oauth2-proxy/oauth2-proxy/pull/3381) fix: do not log error for backend logout 204 (@artificiosus)
1819
1920
2021## Release Highlights
oauthproxy.go+1−1
@@ -798,7 +798,7 @@ func (p *OAuthProxy) backendLogout(rw http.ResponseWriter, req *http.Request) {
798798 }
799799
800800 defer resp.Body.Close()
801− if resp.StatusCode != 200 {
801+ if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent {
802802 logger.Errorf("error while calling backend logout url, returned error code %v", resp.StatusCode)
803803 }
804804}