fix: explicitly set status response header for front-channel logout

Co-Authored-By: Morten Lied Johansen <morten.lied.johansen@nav.no>
Co-Authored-By: Sindre Rødseth Hansen <sindre.rodseth.hansen@nav.no>
This commit is contained in:
Trong Huu Nguyen
2021-10-13 10:43:57 +02:00
parent d0482b3490
commit 5db2a01f63
2 changed files with 3 additions and 0 deletions

View File

@@ -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)
}

View File

@@ -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 {