BREAKING CHANGE: General Bots is now 3.0.
This commit is contained in:
parent
1497119904
commit
c79d226aff
1 changed files with 6 additions and 5 deletions
|
@ -280,12 +280,13 @@ export class GBServer {
|
|||
|
||||
// Setups unsecure http redirect.
|
||||
|
||||
const server1 = http.createServer((req,res)=>{
|
||||
|
||||
const server1 = http.createServer((req, res) => {
|
||||
const host = req.headers.host.startsWith('www.') ?
|
||||
req.headers.host.substring(4) : req.headers.host;
|
||||
res.writeHead(301, {
|
||||
Location: "https://" + req.headers.host + req.url
|
||||
Location: "https://" + host + req.url
|
||||
}).end();
|
||||
});
|
||||
});
|
||||
|
||||
server1.listen(80);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue