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

Cleanups to WebSocket CloseStatus #5597

Merged
merged 1 commit into from
Nov 26, 2020

Conversation

lachlan-roberts
Copy link
Contributor

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

I'd kind of like to see an Enum for this rather than static final ints with switch statements.... but this PR is still an improvement so I'm +0

@@ -343,6 +331,8 @@ public static String codeString(int closeStatus)
return "PROTOCOL";
case BAD_DATA:
return "BAD_DATA";
case RESERVED:
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than have this switch here, that has to be maintained, it really feels like we should have an enum with both the code and the string.... hmmmm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's difficult because we aren't restricted to these defined values here, it could be any int within the 1000-5000 range.

@lachlan-roberts lachlan-roberts merged commit 629e2d6 into jetty-10.0.x Nov 26, 2020
@lachlan-roberts lachlan-roberts deleted the jetty-10.0.x-CloseStatus branch November 26, 2020 01:26
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.

2 participants