Skip to content

Commit

Permalink
Fix crash bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecDusheck committed Sep 26, 2018
1 parent 372f260 commit 94b5380
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 21 deletions.
3 changes: 1 addition & 2 deletions bin/www.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ let sslPort = normalizePort(process.env.PORT || config.sslPort);
*/

const server = http.createServer(function (req, res) {
let hostname = ( req.headers.host.match(/:/g) ) ? req.headers.host.slice(0, req.headers.host.indexOf(":")) : req.headers.host;
res.writeHead(301, {"Location": "https://" + hostname + ":8443" + req.url});
res.writeHead(301, {"Location": "https://" + config.hostname + ":8443" + req.url});
res.end();
});

Expand Down
66 changes: 47 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions server/config/EXAMPLE_CONFIG.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ config.key = "etc/ssl/testing_localhost.key"; //CHANGE THIS!!!! CHANGE THIS!!!!
config.cert = "etc/ssl/testing_localhost.crt"; //CHANGE THIS!!!! CHANGE THIS!!!!
config.sslPort = 8443;
config.port = 8080;
config.hostname = "ephs.club";
module.exports = config;

0 comments on commit 94b5380

Please sign in to comment.