mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
fix(ext/fetch): Guard against invalid URL before its used by reqwest (#17164)
This commit is contained in:
parent
e58cdbcb4b
commit
2a61b5fdd4
2 changed files with 20 additions and 1 deletions
|
@ -93,6 +93,19 @@ Deno.test(
|
|||
},
|
||||
);
|
||||
|
||||
Deno.test(
|
||||
{ permissions: { net: true } },
|
||||
async function fetchMalformedUriError() {
|
||||
await assertRejects(
|
||||
async () => {
|
||||
const url = new URL("http://{{google/");
|
||||
await fetch(url);
|
||||
},
|
||||
TypeError,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Deno.test({ permissions: { net: true } }, async function fetchJsonSuccess() {
|
||||
const response = await fetch("http://localhost:4545/assets/fixture.json");
|
||||
const json = await response.json();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue