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

Document maximum close reason length #5913

Merged
merged 1 commit into from Mar 30, 2020

Conversation

pau101
Copy link
Contributor

@pau101 pau101 commented Mar 29, 2020

This PR adds documentation to the exception which is thrown when the close reason is longer than 123 UTF-8 encoded bytes, addressing concerns from #5594. There are preexisting tests for this behavior yet it is currently undocumented.

@@ -98,8 +98,8 @@ interface WebSocket {
*
* @param code Status code as defined by
* [Section 7.4 of RFC 6455](http://tools.ietf.org/html/rfc6455#section-7.4).
* @param reason Reason for shutting down or null.
* @throws IllegalArgumentException if code is invalid.
* @param reason Reason for shutting down, no longer than 123 bytes of UTF-8 encoded data (**not** characters) or null.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is quite explicit, but given our draconian failures for a String API, probably warranted.

@swankjesse swankjesse merged commit b7a41a9 into square:master Mar 30, 2020
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.

None yet

3 participants