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

Add validation for H1ProtocolConfigBuilder setters #2792

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

H1ProtocolConfigBuilder does not validate incoming int parameters.

Motivation:

`H1ProtocolConfigBuilder` does not validate incoming int parameters.
@@ -67,6 +67,9 @@ public H1ProtocolConfigBuilder headersFactory(final HttpHeadersFactory headersFa
* @return {@code this}
*/
public H1ProtocolConfigBuilder maxPipelinedRequests(final int maxPipelinedRequests) {
if (maxPipelinedRequests <= 0) {
throw new IllegalArgumentException("maxPipelinedRequests: " + maxPipelinedRequests + " (expected >0)");
Copy link
Member Author

Choose a reason for hiding this comment

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

I will send a follow-up later to extract this validation into a common utility for ST

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 good idea

Copy link
Member Author

Choose a reason for hiding this comment

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

My promised follow-up: #2797

@@ -67,6 +67,9 @@ public H1ProtocolConfigBuilder headersFactory(final HttpHeadersFactory headersFa
* @return {@code this}
*/
public H1ProtocolConfigBuilder maxPipelinedRequests(final int maxPipelinedRequests) {
if (maxPipelinedRequests <= 0) {
throw new IllegalArgumentException("maxPipelinedRequests: " + maxPipelinedRequests + " (expected >0)");
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 good idea

@idelpivnitskiy idelpivnitskiy merged commit aeca73c into apple:main Dec 21, 2023
15 checks passed
@idelpivnitskiy idelpivnitskiy deleted the H1ProtocolConfigBuilder branch December 21, 2023 10:02
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