make ACP use HTTPS only if it is enabled

This commit is contained in:
David Siaw 2017-06-12 18:15:00 +09:00
parent fb59de1fb0
commit 23a5578003

View file

@ -28,7 +28,7 @@ function checkAdmin(cb) {
*/
function handleAcp(req, res, user) {
var sio;
if (req.secure || req.header("x-forwarded-proto") === "https") {
if ( Config.get("https.enabled") && (req.secure || req.header("x-forwarded-proto") === "https") ) {
sio = Config.get("https.domain") + ":" + Config.get("https.default-port");
} else {
sio = Config.get("io.domain") + ":" + Config.get("io.default-port");