• Robert Knight's avatar
    Specify status code when closing WebSocket connection from the client · fdedc956
    Robert Knight authored
    Fix browser warnings about an abnormal disconnection when the WS
    connection is closed normally by calling `socket.close()`.
    
    When `WebSocket#close` is called with no code, the browser will send a
    close frame to the server with no payload. This is valid. On the backend
    ws4py translates this into a 1005 status code, which is also correct.
    However, ws4py then responds with the server's close frame and instead
    of sending no payload, it sends a close frame with a payload that has a
    1005 status. This is not allowed by the spec and results in errors in
    the browser about an abnormal disconnection.
    
    Although the proper fix for this needs to happen on the server, the
    simplest solution right now is to set a status code in the client and
    ws4py will respond with the same status code in the server's close
    frame.
    
    As part of this, refactor the tests to clearly separate the tests for
    what happens when the browser/server closes the connection vs when the
    client closes the connection.
    fdedc956
Name
Last commit
Last update
..
integration Loading commit data...
annotation-fixtures.js Loading commit data...
bootstrap.js Loading commit data...
build-thread-test.js Loading commit data...
cross-origin-rpc-test.js Loading commit data...
fake-redux-store.js Loading commit data...
get-api-url-test.js Loading commit data...
group-fixtures.js Loading commit data...
host-config-test.js Loading commit data...
markdown-commands-test.js Loading commit data...
media-embedder-test.js Loading commit data...
render-markdown-test.js Loading commit data...
search-client-test.js Loading commit data...
service-config-test.js Loading commit data...
virtual-thread-list-test.js Loading commit data...
websocket-test.js Loading commit data...