mirror of
https://github.com/caprover/caprover
synced 2026-09-24 23:55:36 +00:00
Use HTTPS for netdata if source is HTTPS
This commit is contained in:
+3
-1
@@ -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 +
|
||||
'/'
|
||||
|
||||
Reference in New Issue
Block a user