Merge pull request #29054 from eugirdor/feature/got/https-requestoptions

[got] Allow use of https.RequestOptions
This commit is contained in:
Nathan Shively-Sanders
2018-09-20 15:14:07 -07:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -258,3 +258,5 @@ got('todomvc', {
got(new url.URL('http://todomvc.com'));
got(url.parse('http://todomvc.com'));
got('https://todomvc.com', { rejectUnauthorized: false });

View File

@@ -75,7 +75,7 @@ declare const got: got.GotFn &
CancelError: typeof CancelError;
};
interface InternalRequestOptions extends http.RequestOptions {
interface InternalRequestOptions extends https.RequestOptions {
// Redeclare options with `any` type for allow specify types incompatible with http.RequestOptions.
timeout?: any;
agent?: any;
@@ -93,7 +93,7 @@ declare namespace got {
type GotStreamFn = (url: GotUrl, options?: GotOptions<string | null>) => GotEmitter & nodeStream.Duplex;
type GotUrl = string | http.RequestOptions | Url | URL;
type GotUrl = string | https.RequestOptions | Url | URL;
interface GotBodyOptions<E extends string | null> extends GotOptions<E> {
body?: string | Buffer | nodeStream.Readable;