From 5db2a01f63406515eaa83e3340fec4ccdc231ef6 Mon Sep 17 00:00:00 2001 From: Trong Huu Nguyen Date: Wed, 13 Oct 2021 10:43:57 +0200 Subject: [PATCH] fix: explicitly set status response header for front-channel logout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Morten Lied Johansen Co-Authored-By: Sindre Rødseth Hansen --- pkg/router/handler_frontchannellogout.go | 1 + pkg/router/router_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pkg/router/handler_frontchannellogout.go b/pkg/router/handler_frontchannellogout.go index ebae726..80bc033 100644 --- a/pkg/router/handler_frontchannellogout.go +++ b/pkg/router/handler_frontchannellogout.go @@ -28,4 +28,5 @@ func (h *Handler) FrontChannelLogout(w http.ResponseWriter, r *http.Request) { // Unconditionally destroy all local references to the session. h.deleteCookie(w, h.GetSessionCookieName()) + w.WriteHeader(http.StatusOK) } diff --git a/pkg/router/router_test.go b/pkg/router/router_test.go index c77e71b..167d9e7 100644 --- a/pkg/router/router_test.go +++ b/pkg/router/router_test.go @@ -329,6 +329,8 @@ func TestHandler_FrontChannelLogout(t *testing.T) { req, err = client.Get(frontchannelLogoutURL.String()) assert.NoError(t, err) defer req.Body.Close() + + assert.Equal(t, http.StatusOK, req.StatusCode) } func getCookieFromJar(name string, cookies []*http.Cookie) *http.Cookie {