Avoid fetch segfault on empty Uri (#1394)

This commit is contained in:
Kevin (Kun) "Kassimo" Qian 2018-12-21 04:47:09 -05:00 committed by Ryan Dahl
parent 105a5193b5
commit e4be1209b6
4 changed files with 25 additions and 4 deletions

View file

@ -47,6 +47,17 @@ testPerm({ net: true }, async function responseClone() {
}
});
testPerm({ net: true }, async function fetchEmptyInvalid() {
let err;
try {
await fetch("");
} catch (err_) {
err = err_;
}
assertEqual(err.kind, deno.ErrorKind.InvalidUri);
assertEqual(err.name, "InvalidUri");
});
// TODO(ry) The following tests work but are flaky. There's a race condition
// somewhere. Here is what one of these flaky failures looks like:
//