Commit bcfadf39 authored by Marvin Scholz's avatar Marvin Scholz

Fix crash due to missing User-Agent

This fixes a crash when the client requesting a listen url
has no User-Agent header set
parent 5bf6ca84
......@@ -33,7 +33,7 @@ function getListen(req, res) {
outputString += listenurls[i]+'\r\n';
}
res.set('Content-Type', 'audio/x-mpegurl');
if(userAgent.indexOf('/MSIE 5.5/') != -1)
if(userAgent && userAgent.indexOf('/MSIE 5.5/') != -1)
{
res.set('Content-Disposition', 'inline; filename="listen.m3u"');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment