fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit c79d226aff - Show all commits

View file

@ -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) {