diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-04-16 22:34:29 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-16 22:34:29 +1000 |
commit | 9c7c9a35c12625bd4793c21539391d6b08d17e73 (patch) | |
tree | dfe6ae0d0a9dcb93b215f51cf0f562a4ed68929d /runtime/js/40_tls.js | |
parent | fe9cee620a4c0d8923bdf99882f95275b69abcb4 (diff) |
fix(#10200): weaken types so non-breaking (#10205)
Fixes #10200
Diffstat (limited to 'runtime/js/40_tls.js')
-rw-r--r-- | runtime/js/40_tls.js | 6 |
1 files changed, 6 insertions, 0 deletions
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, |