-
Couldn't load subscription status.
- Fork 1.2k
Open
Description
This is due to BeforeSend hook is not called when
- No response content
- Scoped plugin
Sample
routing {
route("test") {
install(Sessions) { // not global
cookie<String>(name = "token")
}
post("clear") {
call.sessions.clear("token")
if (call.request.queryParameters["c"] == "1") { // flag to set empty content
call.respond("")
}
call.response.status(HttpStatusCode.OK) // or HttpStatusCode.NoContent
}
}
}curl
> POST /test/clear?c=1 HTTP/1.1
> Host: 127.0.0.1:8080
> Accept: */*
> Cookie: token=foo
>
< HTTP/1.1 200 OK
< Set-Cookie: token=; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/; HttpOnly; $x-enc=URI_ENCODING
< Content-Length: 0
< Content-Type: text/plain; charset=UTF-8
<
> POST /test/clear HTTP/1.1
> Host: 127.0.0.1:8080
> Accept: */*
> Cookie: token=foo
>
< HTTP/1.1 200 OK
< Content-Length: 0
<
Metadata
Metadata
Assignees
Labels
No labels