Refresh the JWT on websocket connect.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3993 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-10-05 01:20:47 +00:00
parent 3cdfc7af2b
commit 5e72b111d9
3 changed files with 26 additions and 13 deletions

View File

@ -246,7 +246,7 @@ function handleWebSocketRequest(request, response, client) {
}
response.onMessage = null;
handler.invoke(request, response);
let extra_headers = handler.invoke(request, response);
client.read(function(data) {
if (data) {
@ -333,7 +333,7 @@ function handleWebSocketRequest(request, response, client) {
if (request.headers["sec-websocket-version"] != "13") {
headers["Sec-WebSocket-Version"] = "13";
}
response.writeHead(101, headers);
response.writeHead(101, Object.assign({}, headers, extra_headers));
}
function webSocketAcceptResponse(key) {