crossbario / autobahn-testsuite

Autobahn WebSocket protocol testsuite
https://crossbar.io/autobahn/
Apache License 2.0
1k stars 84 forks source link

Remove case 7.7.8 (close code 1010 may not be used by server) #123

Open JoakimCh opened 2 years ago

JoakimCh commented 2 years ago

Case description: Send close with valid close code 1010

The problem is that code 1010 may NOT be used by the server.

From RFC6455:

1010 indicates that an endpoint (client) is terminating the
connection because it has expected the server to negotiate one or
more extension, but the server didn't return them in the response
message of the WebSocket handshake.  The list of extensions that
are needed SHOULD appear in the /reason/ part of the Close frame.
Note that this status code is not used by the server, because it
can fail the WebSocket handshake instead.
oberstet commented 2 years ago

The spec text indeed seems pretty clear (not sure, was that added late in a revision? anyways): a test for this close code should only be run when testing clients, not servers.

JoakimCh commented 2 years ago

a test for this close code should only be run when testing clients, not servers.

I'm sorry but this statement doesn't make any sense to me since I was testing a client implementation when getting this code from the Autobahn test server.

The code COULD be tested against the client, but then as an INVALID code from the server, meaning the test must change.

But a second test for clients could be the actually described situation in the quote from RFC6455. Also servers could be testet to accept the code in such situations. If these tests are feasible to do I don't know though.

oberstet commented 2 years ago

ok, so since Autobahn supports the per-message deflate compession WebSocket extension, what could be added is testing a client


realistically, I won't have time to add such stuff .. I'd rather simply remove 1010 from the list here https://github.com/crossbario/autobahn-testsuite/blob/55339e767789fd59d0e46fefcd31930c1f1f112f/autobahntestsuite/autobahntestsuite/case/case7_7_X.py#L22

in the end, just testing for close 1010 without being in the context of extension negotiation is bogus anyways ...

JoakimCh commented 2 years ago

Sounds good to me! Such tests can be added at a later time.