Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket CloseCode Empty/Status is ambiguous #193

Closed
fuchsnj opened this issue Apr 21, 2018 · 2 comments · Fixed by #196
Closed

Websocket CloseCode Empty/Status is ambiguous #193

fuchsnj opened this issue Apr 21, 2018 · 2 comments · Fixed by #196

Comments

@fuchsnj
Copy link
Contributor

fuchsnj commented Apr 21, 2018

The CloseCode::Empty and CloseCode::Status are basically the same code.

According to the RFC, if a client sends no close code (CloseCode::Empty) this is equivalent to 1005 (CloseCode::Status). This can be confusing since it might not be obvious which one of these values you should check against.

I suggest removing CloseCode::Empty and using an Option::None instead.
I would also recommend changing CloseCode::Status to CloseCode::NoStatus to reflect what it actually means.

These are both breaking changes, but if you like them I can make a PR for this.

@fuchsnj
Copy link
Contributor Author

fuchsnj commented Apr 21, 2018

After thinking more... it might make sense to get rid of both of these, and replace them with Option::None

@fafhrd91
Copy link
Member

let's use Option::None, i think it makes sense.

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 a pull request may close this issue.

2 participants