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,10 +280,11 @@ export class GBServer {
|
||||||
|
|
||||||
// Setups unsecure http redirect.
|
// 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, {
|
res.writeHead(301, {
|
||||||
Location: "https://" + req.headers.host + req.url
|
Location: "https://" + host + req.url
|
||||||
}).end();
|
}).end();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue