daphne icon indicating copy to clipboard operation
daphne copied to clipboard

Implement WebSocket Denial Response extension

Open daveisfera opened this issue 2 years ago • 8 comments
trafficstars

The value for code is hard coded to 403 when close happens while connecting

daveisfera avatar Oct 06 '23 00:10 daveisfera

Daphne doesn't implement this: https://asgi.readthedocs.io/en/latest/extensions.html#websocket-denial-response.

Kludex avatar Dec 19 '23 17:12 Kludex

Daphne doesn't implement this: https://asgi.readthedocs.io/en/latest/extensions.html#websocket-denial-response.

I'm not sure what this is supposed to mean. The description sounds like it works and I've tested the change in the linked PR and it works

daveisfera avatar Dec 19 '23 18:12 daveisfera

OK, thanks for looking at it @Kludex.

@daveisfera I'm not sure what the problem here really is, or why/how the PR resolves it. Also there's no tests.

I think to progress it would help to step back and explain what the issue is. Then we can think about the appropriate response.

(Sorry if that seems a pain, but I'm slow sometimes, and I like to understand an issue before just merging a proposal. Thanks.)

carltongibson avatar Dec 19 '23 18:12 carltongibson

The OP wants to send a different status code if the connection is rejected. It can only be done with the WebSocket Denial Response extension.

Kludex avatar Dec 19 '23 19:12 Kludex

Ok, so I can have a read.

@daveisfera fancy doing a fuller job here?

carltongibson avatar Dec 19 '23 19:12 carltongibson

If reference is needed, both Uvicorn and Hypercorn implement the extension.

Kludex avatar Dec 19 '23 19:12 Kludex

Honestly, I've moved onto a different approach, so if you're not interested in resolving this issue, then you can just close this

daveisfera avatar Dec 19 '23 21:12 daveisfera

Ok, thanks for the input. I'll have a read about the extension anyhow.

carltongibson avatar Dec 20 '23 06:12 carltongibson

Duplicate of #389.

carltongibson avatar Oct 08 '24 14:10 carltongibson