1
0
Fork 0
forked from svrjs/svrjs

Change code for Node.JS builds without crypto library

This commit is contained in:
Dorian Niemiec 2024-03-31 18:55:27 +02:00
parent 3b7271386c
commit 5638a45e6e

24
svr.js
View file

@ -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 = "";