Skip to content

Commit 28ffbcd

Browse files
Copilotfengmk2
andauthored
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>
1 parent 718083a commit 28ffbcd

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Request.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ export type RequestOptions = {
161161
/** Default: `64 KiB` */
162162
highWaterMark?: number;
163163
signal?: AbortSignal | EventEmitter;
164+
/**
165+
* If `true`, the server certificate is verified against the list of supplied CAs.
166+
* An 'error' event is emitted if verification fails.
167+
* Default: `true`
168+
*/
169+
rejectUnauthorized?: boolean;
164170
};
165171

166172
export type RequestMeta = {

src/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ export function getDefaultHttpClient(rejectUnauthorized?: boolean, allowH2?: boo
5050
}
5151

5252
interface UrllibRequestOptions extends RequestOptions {
53-
/**
54-
* If `true`, the server certificate is verified against the list of supplied CAs.
55-
* An 'error' event is emitted if verification fails.
56-
* Default: `true`
57-
*/
58-
rejectUnauthorized?: boolean;
5953
/** Allow to use HTTP2 first. Default is `false` */
6054
allowH2?: boolean;
6155
}

0 commit comments

Comments
 (0)