Repository navigation
Echo status code and reason in websocket /echo handler - #2498
Conversation
|
Critic review: https://critic.hoppipolla.co.uk/r/6115 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
|
Reviewers for this pull request are: @w3c/websockets-reviewers. |
|
cc @zcorpan who I believe has done a bunch of work with the websockets tests in the past? Who else should take a look at this? |
|
FWIW Chrome also fails those tests. |
|
If someone is interested in history here: IIRC the top-level tests were submitted by Microsoft, and it appears they ended up reusing the existing I was a bit worried that this change would regress other websocket tests, but I didn't find anything that checked LGTM |
Echo status code and reason in websocket /echo handler
|
Great, thanks @zcorpan. |
This echoes the WebSocket close code (except
NO_STATUS) and reason sent by the client close frame in the server's close frame.A few tests rely on the final close code and reason being the same as that sent by the client. Section 7.1.5 of RFC6455 states that "The WebSocket Connection Close Code is defined as the status code contained in the first Close control frame received by the application implementing this protocol", suggesting that the server needs to echo the code for those tests to pass. There is very similar language for the close reason in section 7.1.6.
Firefox appears to implement the behavior I would expect from the wording in the spec, and fails the following tests, which I believe this change will fix:
http://w3c-test.org/websockets/Close-reason-unpaired-surrogates.htm
http://w3c-test.org/websockets/Secure-Close-1000-verify-code.htm
http://w3c-test.org/websockets/Secure-Close-1005-verify-code.htm
http://w3c-test.org/websockets/Secure-Close-3000-verify-code.htm
http://w3c-test.org/websockets/Secure-Close-Reason-Unpaired-surrogates.htm