From 5638a45e6edc06798aa4a04d98d80bf791cdbb9b Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sun, 31 Mar 2024 18:55:27 +0200 Subject: [PATCH] Change code for Node.JS builds without crypto library --- svr.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/svr.js b/svr.js index d31b920..0f3abcb 100644 --- a/svr.js +++ b/svr.js @@ -448,21 +448,23 @@ try { crypto = require("crypto"); https = require("https"); } catch (err) { - crypto = {}; - https = {}; - crypto.__disabled__ = null; - https.createServer = function () { - throw new Error("Crypto support is not present"); + crypto = { + __disabled__: null + }; + https = { + createServer: function () { + throw new Error("Crypto support is not present"); + }, + connect: function () { + throw new Error("Crypto support is not present"); + }, + get: function () { + throw new Error("Crypto support is not present"); + } }; http2.createSecureServer = function () { throw new Error("Crypto support is not present"); }; - https.connect = function () { - throw new Error("Crypto support is not present"); - }; - https.get = function () { - throw new Error("Crypto support is not present"); - }; } var mime = require("mime-types"); var pubip = "";