Added a bunch of HTTP to HTTPS redirections.
Ylian Saint-Hilaire committed
Aug 9, 2019 at 15:38 UTC
d2bb4e98403bb42d85b4c2db746e02c42d36ac8c
2 files changed
+6
-2
package.json
+1
-1
@@ -1,6 +1,6 @@
1
{
2
"name": "meshcentral",
3
- "version": "0.3.9-o",
3
+ "version": "0.3.9-p",
4
"keywords": [
5
"Remote Management",
6
"Intel AMT",
redirserver.js
+5
-1
@@ -94,8 +94,12 @@ module.exports.CreateRedirServer = function (parent, db, args, func) {
94
for (var i in parent.config.domains) {
95
if (parent.config.domains[i].dns != null) { continue; }
96
var url = parent.config.domains[i].url;
97
- obj.app.get(url, performRedirection);
97
+ obj.app.get(url, performRedirection); // Root redirection
98
obj.app.use(url + "clickonce", obj.express.static(obj.parent.path.join(__dirname, "public/clickonce"))); // Indicates the clickonce folder is public
99
+
100
+ // Setup all of the redirections to HTTPS
101
+ const redirections = ['terms', 'logout', 'MeshServerRootCert.cer', 'mescript.ashx', 'checkmail', 'agentinvite', 'messenger', 'meshosxagent', 'devicepowerevents.ashx', 'downloadfile.ashx', 'userfiles/*', 'webrelay.ashx', 'health.ashx', 'logo.png', 'welcome.jpg'];
102
+ for (i in redirections) { obj.app.get(url + redirections[i], performRedirection); }
103
}
104
105
// Find a free port starting with the specified one and going up.