Summary
The DynamoDB module (lib/dynamo/index.js) has its own setupHTTPAgent function that duplicates the HTTP agent setup logic already available in the shared setHttpAgent utility (lib/utils.js).
This duplication was introduced when adding support for http.Agent on non-HTTPS endpoints (e.g., local DynamoDB). The same logic already exists in lib/utils.js and is used by the SQS module.
Proposed Changes
- Update
setHttpAgent in lib/utils.js to handle both string endpoints ('http://localhost:8000') and AWS.Endpoint objects ({ protocol: 'http:' })
- Refactor
lib/dynamo/index.js to remove the duplicated setupHTTPAgent and delegate to the shared setHttpAgent
- Add test coverage for string endpoint handling in
utils.spec.js
🤖 Generated with Claude Code