Repository navigation
fix(gaxios): forward https.Agent TLS options and agent factories in Bun - #9774
danieljbruce wants to merge 1 commit into
Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request enhances the Bun fetch implementation in Gaxios to support more flexible agent configurations, including agent factory functions and extracting additional TLS options such as ca, passphrase, and rejectUnauthorized from the agent's options or connection options. Corresponding unit tests have been added to verify that these options are correctly mapped to the tls configuration. I have no feedback to provide.
There was a problem hiding this comment.
Code Review
This pull request enhances the Bun fetch implementation in Gaxios by adding support for custom HTTPS agents and agent factory functions. It correctly extracts TLS options such as cert, key, ca, passphrase, and rejectUnauthorized from the agent's options or connection options and maps them to the TLS configuration. Corresponding unit tests have been added to verify this behavior. There are no review comments, and I have no additional feedback to provide.
d3f1faa to
6d4fcaa
Compare
Description
Forwards
https.AgentTLS options and resolves agent factory functions under Bun.Impact
Restores custom CA, passphrase,
rejectUnauthorized, and agent factory parity on Bun.Changes
rawInit.agentinGaxios.#createBunFetch()when passed as a factory function(parsedUrl: URL) => Agent.cert,key,ca,passphrase, andrejectUnauthorizedfrom bothconnectOpts(HttpsProxyAgent) andoptions(https.Agent) intorawInit.tls.Stack
fix(gaxios): enforce maxContentLength on headerless responses in Bun(fix/gaxios-bun-max-content-length→main)fix(gaxios): enforce maxContentLength on stream responses in Bun(fix/gaxios-bun-max-content-length-stream→fix/gaxios-bun-max-content-length)fix(gaxios): honor maxContentLength and maxRedirects instance defaults(fix/gaxios-instance-defaults→fix/gaxios-bun-max-content-length-stream)fix(gaxios): forward https.Agent TLS options and agent factories in Bun(fix/gaxios-bun-agent-tls→fix/gaxios-instance-defaults) (this PR)Testing
core/packages/gaxios/test/test.getch.tsverifyinghttps.AgentTLS options (cert,key,ca,passphrase,rejectUnauthorized) and(parsedUrl: URL) => Agentfactory functions inGaxios.#createBunFetch().cd core/packages/gaxios && pnpm run compile && JS_RUNTIME=bun MOCHA_PARALLEL=false bun --bun ../../../bin/run-test.cjs --no-c8 build/esm/test/test.getch.js -g "pass proxy and tls options".Alternatives
HttpsProxyAgent(connectOpts.cert/connectOpts.key) was rejected because directnew https.Agent({...})instances and(url) => Agentfactories are standardgaxiosconfigurations supported on Node.js.https.AgentTLS settings (ca,passphrase,rejectUnauthorized) are silently dropped under Bun.