| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
npm i https://pkg.pr.new/node-modules/urllib@741 commit: 493446b |
Sorry, something went wrong.
|
@copilot add type check unit test for this change. |
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #741 +/- ##
=======================================
Coverage 94.91% 94.91%
=======================================
Files 10 10
Lines 747 747
Branches 235 235
=======================================
Hits 709 709
Misses 35 35
Partials 3 3 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
Added a type check unit test in test/options.rejectUnauthorized.typecheck.test.ts that explicitly types options as RequestOptions with rejectUnauthorized set, verifying the type compiles and works at runtime (commit 701a8e0). |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR makes rejectUnauthorized part of the exported RequestOptions type so library consumers can pass it without TypeScript errors when typing options as RequestOptions.
Changes:
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/index.ts | Removes the internal-only rejectUnauthorized option from UrllibRequestOptions now that it’s provided by RequestOptions. |
| src/Request.ts | Adds rejectUnauthorized?: boolean to the exported RequestOptions type (with JSDoc). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was a problem hiding this comment.
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| /** | ||
| * If `true`, the server certificate is verified against the list of supplied CAs. | ||
| * If verification fails, the request promise is rejected. | ||
| * | ||
| * This option is only effective when using the top-level request/curl wrapper with | ||
| * its default dispatcher. It may be ignored when using `HttpClient.request()` | ||
| * directly or when `dispatcher` is explicitly provided. | ||
| * | ||
| * Default: `true` | ||
| */ | ||
| rejectUnauthorized?: boolean; |
There was a problem hiding this comment.
RequestOptions is also the options type for HttpClient.request(), but HttpClient never reads options.rejectUnauthorized (it only comes from ClientOptions.connect.rejectUnauthorized or a provided dispatcher). With this change, TypeScript will now accept httpclient.request(url, { rejectUnauthorized: false }), but it will be a no-op at runtime. Consider scoping this to a wrapper-only options type (e.g. exporting a separate UrllibRequestOptions) or implementing per-request handling so the type matches behavior.
Sorry, something went wrong.
Move `rejectUnauthorized` from the private `UrllibRequestOptions` interface to the public `RequestOptions` type so it can be passed to the top-level `request()`/`curl()` wrapper without a TypeScript error and without constructing a custom HttpClient. Since `allowH2` is already part of `RequestOptions`, the private `UrllibRequestOptions` interface became redundant and is removed; `request()`/`curl()` now use `RequestOptions` directly.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.