Use HTTPS for netdata if source is HTTPS

This commit is contained in:
Kasra Bigdeli
2020-04-30 19:21:52 -04:00
committed by GitHub
parent 3e99a888c4
commit 3cac9bbead
+3 -1
View File
@@ -108,8 +108,10 @@ app.use(CaptainConstants.netDataRelativePath, function(req, res, next) {
req.originalUrl.indexOf(CaptainConstants.netDataRelativePath + '/') !==
0
) {
let isRequestSsl = req.secure || req.get('X-Forwarded-Proto') === 'https'
let newUrl =
'http://' +
(isRequestSsl? 'https://' : 'http://') +
req.get('host') +
CaptainConstants.netDataRelativePath +
'/'