Skip to content

Conversation

@aminalaee
Copy link
Contributor

@aminalaee aminalaee commented Jan 15, 2022

Closes #991.

According to the ASGI spec here reason can be included in websocket.close which is an optional string.

I think what @Kludex mentioned here makes sense:

- We can include code in websocket.close only when it's specified in Starlette, and don't include it when not set, as per the ASGI spec it is optional int and already handled by Uvicorn here and Daphne here and Hypercorn here.

  • We will include reason in websocket.close only when it's specified as per the ASGI spec it's optional and will be handled by ASGI servers.

Any feedback would be appreciated.

Copy link
Owner

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the default value change on code, but that is another issue, and it's also considered a breaking change.

@aminalaee aminalaee requested a review from Kludex January 17, 2022 18:36
Copy link
Owner

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment, but your call.

Everything is cool 👍 Thanks! 🎉

aminalaee and others added 2 commits January 22, 2022 12:03
@aminalaee aminalaee mentioned this pull request Jan 22, 2022
8 tasks
@aminalaee aminalaee merged commit 34d9f0f into Kludex:master Jan 22, 2022
@aminalaee aminalaee deleted the add-websocket-close-reason branch January 22, 2022 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Reason for websocket.close

2 participants