I believe the problem might be with the return value of session/invalidate-session
. So try something like this:
(POST "/service/logout" {headers :headers}
(do (session/invalidate-session
(headers "x-auth-token"))
""))
Compojure tries to be clever about doing the right thing with the return values of routes and this often ends up causing problems such as this.