@@ -22,6 +22,26 @@ describe("when the configured logout uri is invoked with a non-image request", f
2222 end )
2323end )
2424
25+ describe (" when the configured logout uri is invoked with Firefox 128's default Accept" , function ()
26+ test_support .start_server ()
27+ teardown (test_support .stop_server )
28+ local _ , _ , cookie = test_support .login ()
29+ local _ , status , headers = http .request ({
30+ url = " http://127.0.0.1/default/logout" ,
31+ headers = { cookie = cookie , accept = " text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8" },
32+ redirect = false
33+ })
34+ it (" the response contains a default HTML-page" , function ()
35+ assert .are .equals (200 , status )
36+ assert .are .equals (" text/html" , headers [" content-type" ])
37+ -- TODO should there be a Cache-Control header?
38+ end )
39+ it (" the session cookie has been revoked" , function ()
40+ assert .truthy (string.match (headers [" set-cookie" ],
41+ " session=; Expires=Thu, 01 Jan 1970 00:00:01 GMT.*" ))
42+ end )
43+ end )
44+
2545describe (" when the configured logout uri is invoked with a png request" , function ()
2646 -- TODO should this really take precedence over a configured end_session_endpoint?
2747 test_support .start_server ({
@@ -38,7 +58,7 @@ describe("when the configured logout uri is invoked with a png request", functio
3858 headers = { cookie = cookie , accept = " image/png" },
3959 redirect = false
4060 })
41- it (" the response contains a default HTML-page " , function ()
61+ it (" the response contains a default PNG image " , function ()
4262 assert .are .equals (200 , status )
4363 assert .are .equals (" image/png" , headers [" content-type" ])
4464 assert .are .equals (" no-cache, no-store" , headers [" cache-control" ])
0 commit comments