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
11
src/app.ts
11
src/app.ts
|
@ -280,13 +280,14 @@ 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);
|
||||
|
||||
if (process.env.CERTIFICATE_PFX) {
|
||||
|
|
Loading…
Add table
Reference in a new issue