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

Support disabling body aggregation in NIOHTTP1TestServer #2563

Merged

Conversation

simonjbeaumont
Copy link
Contributor

Motivation:

NIOTestUtils provides NIOHTTP1TestServer which is useful for testing client-server interactions. Currently it uses an inbound channel handler to aggregate the entire body, which means it cannot be used to test streaming requests.

Modifications:

  • Add another initializer, which takes an aggregateBody boolean parameter.
  • Only add AggregateBodyHandler to the channel pipeline if aggregateBody is true.

Result:

Adopters can use NIOHTTP1TestServer to test streaming request patterns.

@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Oct 20, 2023
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Love it, very good.

@Lukasa Lukasa merged commit f71ae34 into apple:main Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants