[node-fetch] Make ResponseInit url optional (#35414)

This commit is contained in:
Brandon Wilson
2019-05-16 07:57:32 -07:00
committed by Nathan Shively-Sanders
parent be73d79797
commit df31e13c58
2 changed files with 4 additions and 5 deletions
+3 -2
View File
@@ -6,6 +6,7 @@
// Antonio Román <https://github.com/kyranet>
// Andrew Leedham <https://github.com/AndrewLeedham>
// Jason Li <https://github.com/JasonLi914>
// Brandon Wilson <https://github.com/wilsonianb>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -179,7 +180,7 @@ export interface ResponseInit {
status?: number;
statusText?: string;
timeout?: number;
url: string;
url?: string;
}
export type HeadersInit = Headers | string[][] | { [key: string]: string };
@@ -194,7 +195,7 @@ export type BodyInit =
export type RequestInfo = string | Request;
declare function fetch(
url: string | Request,
url: RequestInfo,
init?: RequestInit
): Promise<Response>;
+1 -3
View File
@@ -117,9 +117,7 @@ function test_Blob() {
function test_ResponseInit() {
fetch("http://test.com", {}).then(response => {
new Response(response.body, {
url: response.url,
});
new Response(response.body);
new Response(response.body, {
url: response.url,
size: response.size,