ASGITestClient doesn't send websocket close code on disconnect
villekr opened this issue · comments
Ville Kr commented
ASGITestClient doesn't send websocket close code, which is mandatory value in ASGI specification. Currently only "type" is send.
https://asgi.readthedocs.io/en/latest/specs/www.html#disconnect-receive-event-ws
async def disconnect(self):
await self.send({'type': 'websocket.disconnect'})
self.state = self.STATES.disconnected
WebSocket error codes:
https://datatracker.ietf.org/doc/html/rfc6455#section-7.4
Kirill Klenov commented
@villekr Thank you 🙏. The client has been updated (asgi-tools 0.61.5
).
Ville Kr commented
Works now. Thanks for quick fix!