diff options
Diffstat (limited to 'cli/js/tls_test.ts')
-rw-r--r-- | cli/js/tls_test.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cli/js/tls_test.ts b/cli/js/tls_test.ts index 58cafd23e..6966a6911 100644 --- a/cli/js/tls_test.ts +++ b/cli/js/tls_test.ts @@ -184,7 +184,10 @@ testPerm({ read: true, net: true }, async function dialAndListenTLS(): Promise< await w.flush(); const tpr = new TextProtoReader(r); const statusLine = await tpr.readLine(); - assert(!!statusLine, "line must be read: " + statusLine); + assert(statusLine !== Deno.EOF, `line must be read: ${String(statusLine)}`); + if (statusLine === Deno.EOF) { + return; + } const m = statusLine.match(/^(.+?) (.+?) (.+?)$/); assert(m !== null, "must be matched"); const [_, proto, status, ok] = m; @@ -192,6 +195,10 @@ testPerm({ read: true, net: true }, async function dialAndListenTLS(): Promise< assertEquals(status, "200"); assertEquals(ok, "OK"); const headers = await tpr.readMIMEHeader(); + assert(headers !== Deno.EOF); + if (headers === Deno.EOF) { + return; + } const contentLength = parseInt(headers.get("content-length")); const bodyBuf = new Uint8Array(contentLength); await r.readFull(bodyBuf); |