Skip to content

Commit ee86ba4

Browse files
committed
fix(api): update apiFetch comment to describe permanent behaviour
1 parent fd815df commit ee86ba4

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/utils/api.mts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,11 @@ function getHttpsAgent(): HttpsAgent | undefined {
7272
return _httpsAgent
7373
}
7474

75-
// Wrapper around fetch using node:https.request for all calls.
76-
// This avoids undici's default 300 s bodyTimeout, which would otherwise fire
77-
// on large streaming responses before the body has fully transferred. Behaviour
78-
// matches the SDK, which also uses node:https.request with no body timeout.
79-
// Passes the custom HTTPS agent when extra CA certificates are configured via
80-
// SSL_CERT_FILE, otherwise uses Node's default agent. Follows redirects like fetch().
75+
// All outbound API requests use node:https.request rather than global fetch.
76+
// This ensures no body timeout is applied — large streaming ND-JSON responses
77+
// (e.g. full scan results) can transfer without a hard deadline. When
78+
// SSL_CERT_FILE is configured, a custom HttpsAgent carrying the extra CA
79+
// certificates is passed; otherwise the default agent is used.
8180
export type ApiFetchInit = {
8281
body?: string | undefined
8382
headers?: Record<string, string> | undefined

0 commit comments

Comments
 (0)