From e4be1209b6216ad12729981947c0725b5ccc55a5 Mon Sep 17 00:00:00 2001 From: "Kevin (Kun) \"Kassimo\" Qian" Date: Fri, 21 Dec 2018 04:47:09 -0500 Subject: Avoid fetch segfault on empty Uri (#1394) --- js/fetch_test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'js/fetch_test.ts') diff --git a/js/fetch_test.ts b/js/fetch_test.ts index 74a383649..cd3e6ebf0 100644 --- a/js/fetch_test.ts +++ b/js/fetch_test.ts @@ -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: // -- cgit v1.2.3