mirror of
https://github.com/denoland/deno.git
synced 2025-09-29 21:54:48 +00:00
fix(op_crates/fetch): Prevent throwing when inspecting a request (#10335)
Fixes: #10334
This commit is contained in:
parent
c5fda85ef0
commit
feb6af7732
2 changed files with 15 additions and 1 deletions
|
@ -53,3 +53,17 @@ unitTest(async function cloneRequestBodyStream(): Promise<void> {
|
||||||
|
|
||||||
assertEquals(b1, b2);
|
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/"
|
||||||
|
}`,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
|
@ -392,7 +392,7 @@
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
method: this.method,
|
method: this.method,
|
||||||
redirect: this.redirect,
|
redirect: this.redirect,
|
||||||
url: this.url(),
|
url: this.url,
|
||||||
};
|
};
|
||||||
return `Request ${inspect(inner)}`;
|
return `Request ${inspect(inner)}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue