From 718083a689c4102e13dbff19a6fffd30ea14520f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Apr 2026 12:04:27 +0000 Subject: [PATCH 1/2] Initial plan From 28ffbcd8897ab637da5e20ee12a06066b4e6d4ad Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Apr 2026 12:07:00 +0000 Subject: [PATCH 2/2] feat: add rejectUnauthorized to RequestOptions interface Move rejectUnauthorized from the private UrllibRequestOptions interface to the public RequestOptions type, making it available to all users of the library without needing to create a custom HttpClient. Agent-Logs-Url: https://github.com/node-modules/urllib/sessions/a83a8fb1-4491-44da-aa68-7bf7d05a4ad4 Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> --- src/Request.ts | 6 ++++++ src/index.ts | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Request.ts b/src/Request.ts index 0d91a8d6..66c20da8 100644 --- a/src/Request.ts +++ b/src/Request.ts @@ -161,6 +161,12 @@ export type RequestOptions = { /** Default: `64 KiB` */ highWaterMark?: number; signal?: AbortSignal | EventEmitter; + /** + * If `true`, the server certificate is verified against the list of supplied CAs. + * An 'error' event is emitted if verification fails. + * Default: `true` + */ + rejectUnauthorized?: boolean; }; export type RequestMeta = { diff --git a/src/index.ts b/src/index.ts index 525679bb..b94e70d5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -50,12 +50,6 @@ export function getDefaultHttpClient(rejectUnauthorized?: boolean, allowH2?: boo } interface UrllibRequestOptions extends RequestOptions { - /** - * If `true`, the server certificate is verified against the list of supplied CAs. - * An 'error' event is emitted if verification fails. - * Default: `true` - */ - rejectUnauthorized?: boolean; /** Allow to use HTTP2 first. Default is `false` */ allowH2?: boolean; }