Skip to content

Add rejectUnauthorized to RequestOptions#741

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/add-reject-unauthorized-to-request-options
Draft

Add rejectUnauthorized to RequestOptions#741
Copilot wants to merge 2 commits intomasterfrom
copilot/add-reject-unauthorized-to-request-options

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

rejectUnauthorized was only on a private UrllibRequestOptions interface in src/index.ts, not on the exported RequestOptions type. Users couldn't pass it without TypeScript errors when typing their options against RequestOptions.

  • Moved rejectUnauthorized?: boolean from private UrllibRequestOptions to the public RequestOptions type in src/Request.ts
  • UrllibRequestOptions now inherits it via extends RequestOptions
import urllib, { RequestOptions } from 'urllib';

const opts: RequestOptions = {
  rejectUnauthorized: false, // now valid
  dataType: 'json',
};
const response = await urllib.request(url, opts);

Copilot AI linked an issue Apr 12, 2026 that may be closed by this pull request
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>
Copilot AI changed the title [WIP] Add rejectUnauthorized to RequestOptions interface Add rejectUnauthorized to RequestOptions Apr 12, 2026
Copilot AI requested a review from fengmk2 April 12, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rejectUnauthorized to RequestOptions

2 participants