1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

fix(op_crates/fetch): Prevent throwing when inspecting a request (#10335)

Fixes: #10334
This commit is contained in:
Jesse Jackson 2021-04-23 13:38:45 -05:00 committed by GitHub
parent c5fda85ef0
commit feb6af7732
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -53,3 +53,17 @@ unitTest(async function cloneRequestBodyStream(): Promise<void> {
assertEquals(b1, b2);
});
unitTest(function customInspectFunction(): void {
const request = new Request("https://example.com");
assertEquals(
Deno.inspect(request),
`Request {
bodyUsed: false,
headers: Headers {},
method: "GET",
redirect: "follow",
url: "https://example.com/"
}`,
);
});

View file

@ -392,7 +392,7 @@
headers: this.headers,
method: this.method,
redirect: this.redirect,
url: this.url(),
url: this.url,
};
return `Request ${inspect(inner)}`;
}