fix(bruno-requests): address code review findings for agent caching

- Fix Buffer hashing bug: properly handle Buffer values in hashValue()
- Add CA array support: new hashCaValue() handles string[] | Buffer[]
- Fix timeline race condition: capture timeline reference in closure
  at createConnection start to isolate concurrent requests
- Fix SSL verify message: check socket.authorized for accurate status
- Fix HTTP/HTTPS agent logic: only set httpsAgent for HTTPS requests
- Add tests for concurrent requests timeline isolation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
lohit-bruno
2026-01-30 15:50:39 +05:30
parent 14c66bc42f
commit 15c86f8e6b
5 changed files with 186 additions and 32 deletions

View File

@@ -486,8 +486,6 @@ const runSingleRequest = async function (
if (https_proxy?.length && isHttpsRequest) {
new URL(https_proxy);
request.httpsAgent = getOrCreateAgent(PatchedHttpsProxyAgent, tlsOptions, https_proxy);
} else {
request.httpsAgent = getOrCreateAgent(https.Agent, tlsOptions);
}
} catch (error) {
throw new Error('Invalid system https_proxy');