From 9c7c9a35c12625bd4793c21539391d6b08d17e73 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Fri, 16 Apr 2021 22:34:29 +1000 Subject: fix(#10200): weaken types so non-breaking (#10205) Fixes #10200 --- runtime/js/40_tls.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runtime/js') diff --git a/runtime/js/40_tls.js b/runtime/js/40_tls.js index 4fafe9079..ea094b6a7 100644 --- a/runtime/js/40_tls.js +++ b/runtime/js/40_tls.js @@ -68,6 +68,12 @@ conn, { hostname = "127.0.0.1", certFile } = {}, ) { + if ( + !(conn.localAddr.transport === "tcp" || + conn.localAddr.transport === "udp") + ) { + throw new TypeError(`conn is not a valid network connection`); + } const res = await opStartTls({ rid: conn.rid, hostname, -- cgit v1.2.3