diff --git a/src/routes/station.ts b/src/routes/station.ts index f4b18cc..d5cb22e 100644 --- a/src/routes/station.ts +++ b/src/routes/station.ts @@ -9,7 +9,7 @@ const router = Router(); router.get('/', async (req: Request, res: Response) => { res.render('stations', { stations: stationProvider.stations, - protocol: config['xspf_protocol'] || req.protocol, + protocol: config.xspf_protocol || req.protocol, host: config.xspf_host || req.get('X-Forwarded-Host') || req.get('Host'), pathPrefix: config.xspf_pathPrefix }); @@ -18,7 +18,7 @@ router.get('/', async (req: Request, res: Response) => { router.get('/download', (req: Request, res: Response) => { res.setHeader('Content-Type', 'application/xspf+xml'); res.setHeader('Content-Disposition', 'attachment; filename="IPTV-ReStream.xspf"'); - const protocol = config['xspf_protocol'] || req.protocol; + const protocol = config.xspf_protocol || req.protocol; const host = config.xspf_host || req.get('X-Forwarded-Host') || req.get('Host'); const pathPrefix = config.xspf_pathPrefix; res.write(xspfProvider.generateXSPF(`${protocol}://${host}${pathPrefix}`)); @@ -28,7 +28,7 @@ router.get('/download', (req: Request, res: Response) => { router.get('/downloadm3u', (req: Request, res: Response) => { res.setHeader('Content-Type', 'application/x-mpegURL'); res.setHeader('Content-Disposition', 'attachment; filename="IPTV-ReStream.m3u"'); - const protocol = config['xspf_protocol'] || req.protocol; + const protocol = config.xspf_protocol || req.protocol; const host = config.xspf_host || req.get('X-Forwarded-Host') || req.get('Host'); const pathPrefix = config.xspf_pathPrefix; res.write(m3uProvider.generateM3U(`${protocol}://${host}${pathPrefix}`));