refactor: reuse shared setHttpAgent in DynamoDB module#89
Draft
rafaelmatsumotomb wants to merge 2 commits intomainfrom
Draft
refactor: reuse shared setHttpAgent in DynamoDB module#89rafaelmatsumotomb wants to merge 2 commits intomainfrom
rafaelmatsumotomb wants to merge 2 commits intomainfrom
Conversation
… DynamoDB module Remove duplicated setupHTTPAgent from DynamoDB module and delegate to the shared setHttpAgent utility in lib/utils.js. Update setHttpAgent to handle both string endpoints and AWS.Endpoint objects. Add test coverage for string endpoint handling. Closes #88 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Restore httpOptions guard in TF case to preserve original behavior - Handle case-insensitive http:// string endpoints in setHttpAgent - Add DynamoDB client tests for FT throw, TF agent deletion, default https agent, and http string endpoint cases - Add utils test for uppercase HTTP string endpoint Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
setupHTTPAgentfromlib/dynamo/index.jsand delegate to the sharedsetHttpAgentutility inlib/utils.jssetHttpAgentto handle both string endpoints ('http://localhost:8000') andAWS.Endpointobjects ({ protocol: 'http:' })Closes #88
🤖 Generated with Claude Code
Note
Medium Risk
Touches AWS client networking configuration (proxy/keepalive agent selection) for DynamoDB, which can impact connectivity and performance if misconfigured. Changes are small and covered by new unit tests for the new endpoint-detection branches.
Overview
Refactors DynamoDB client creation to remove the local
setupHTTPAgentimplementation and instead delegate keepalive/proxy agent setup to the sharedutils.setHttpAgent, while preserving the existingbypassProxy/useKeepalivesbehavior (including erroring on proxy+keepalive and clearing any pre-set agent when keepalives are disabled).Enhances
setHttpAgentto detect HTTP vs HTTPS whenconfig.endpointis provided as a string (case-insensitive) in addition toAWS.Endpointobjects, and adds unit tests covering these DynamoDB and utility-agent selection scenarios.Written by Cursor Bugbot for commit 9bc277e. This will update automatically on new commits. Configure here.