Add tests verifying custom HTTPClient with proxy configuration#323
Draft
Add tests verifying custom HTTPClient with proxy configuration#323
Conversation
Tests verify that custom HTTPClient with proxy settings is properly used through both direct client.SendRequest and RequestHandler.Get paths. Co-authored-by: manisha1997 <28821901+manisha1997@users.noreply.github.com>
Tests verify custom HTTPClient flows correctly through the full RestClient -> RequestHandler -> Client chain and that SetTimeout preserves the custom HTTPClient instance. Co-authored-by: manisha1997 <28821901+manisha1997@users.noreply.github.com>
Tests verify the exact scenario from the issue description: - Custom HTTPClient with http.ProxyURL is properly configured - Proxy function is actually called when making requests - Proxy URL configuration is preserved through the client chain All tests pass, confirming the reported issue does not exist in the current codebase. Co-authored-by: manisha1997 <28821901+manisha1997@users.noreply.github.com>
Add explicit verification that HTTPClient is nil before first use when using default client creation (lazy initialization pattern). Co-authored-by: manisha1997 <28821901+manisha1997@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix custom HTTPClient with proxy not used in API requests
Add tests verifying custom HTTPClient with proxy configuration
Feb 23, 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.
Issue claimed custom HTTPClient with proxy settings is ignored when passed via
ClientParams. Investigation confirms this is not a bug - the implementation correctly uses custom HTTPClient throughout the request chain.Changes
Added comprehensive test coverage (3 test files, ~400 LOC):
Unit tests (
client/custom_httpclient_test.go)Integration tests (
twilio_custom_httpclient_integration_test.go)Proxy scenario tests (
twilio_proxy_test.go)http.ProxyURLconfigurationExample Usage (from tests)
No production code changes required. Tests serve as regression protection and usage documentation.
Warning
GitHub's Secret Scanning detected potential secrets in the added content. We attempted to remediate the issue by updating the code or redacting.
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.