Close WebSocket connection normally

With Tubesock, we need to send a close frame ourselves. Otherwise, some browsers might display a warning.
This commit is contained in:
Sebastian Serth
2022-11-16 23:16:49 +01:00
parent 7aaeac03d6
commit 591f776f69

View File

@ -298,6 +298,7 @@ class SubmissionsController < ApplicationController
def kill_client_socket(client_socket)
# We don't want to store this (arbitrary) exit command and redirect it ourselves
client_socket.send_data JSON.dump({cmd: :exit})
client_socket.send_data nil, :close
client_socket.close
end