mirror of
https://github.com/balkian/go5ears.git
synced 2024-11-22 05:12:29 +00:00
Safely parse the response from goear (avoid resets)
This commit is contained in:
parent
1cf3f5d803
commit
62eff02fee
@ -74,6 +74,7 @@ app.get('/play', function(req,resp){
|
||||
parser.parseString(xml, function(err,result){
|
||||
console.log("xml: "+xml);
|
||||
console.log("Object: "+JSON.stringify(result));
|
||||
try{
|
||||
var song = result['songs']['song'][0]["$"];
|
||||
console.log("Song:"+JSON.stringify(song));
|
||||
var path = song['path'];
|
||||
@ -84,6 +85,7 @@ app.get('/play', function(req,resp){
|
||||
'Location': path
|
||||
//add other headers here...
|
||||
});
|
||||
}
|
||||
resp.end();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user