Repository navigation
fix: respect client-configured request config in NetworkHttpClient - #990
Merged
Merged
Conversation
makeRequest overrode the RequestConfig passed to the constructor with DEFAULT_REQUEST_CONFIG on every request, so custom response timeouts were ignored. Remove the override so the client's default config applies. TECHEMPROD-3081 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
shrutiburman
reviewed
Nov 3, 2026
| HttpMethod method = request.getMethod(); | ||
| HttpUriRequestBase httpUriRequestBase = createHttpUriRequestBase(request); | ||
|
|
||
| httpUriRequestBase.setConfig(DEFAULT_REQUEST_CONFIG); |
Contributor
There was a problem hiding this comment.
What happens if there is no request_config set in the request?
Can we instead set default if the config is not found?
Contributor
Author
There was a problem hiding this comment.
If config is not set, it is set
When the Object of NetworkHTTPClient is created.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change to honor client-configured request settings.
No open issues 🎉
What changed in this PR
Fixes NetworkHttpClient so requests respect the client-configured RequestConfig, including custom response timeouts.
Changes:
- Removes the per-request configuration override, allowing the client builder’s configuration to apply.
- Adds a regression test using a slow local server to verify that a 300 ms response timeout is honored.
| File | Description |
|---|---|
src/test/java/com/twilio/http/NetworkHttpClientTest.java |
Adds regression coverage for custom response timeouts. |
src/main/java/com/twilio/http/NetworkHttpClient.java |
Removes the default configuration override from makeRequest. |
Review effort: Balanced
shrutiburman
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NetworkHttpClient.makeRequestcalledsetConfig(DEFAULT_REQUEST_CONFIG)on every request, overriding theRequestConfigpassed to the constructor, so a user-configured response timeout was ignored.testCustomResponseTimeoutIsRespected, which uses a local slow server and a 300 ms response timeout.Jira: TECHEMPROD-3081
Test plan
NetworkHttpClientTestpasses (JDK 17)🤖 Generated with Claude Code