Updated response to check if there needs to be [] added to ensure JSON validity
This commit is contained in:
parent
3edb0d4548
commit
88dca3688e
1 changed files with 8 additions and 1 deletions
|
@ -103,7 +103,14 @@ http.createServer(function(request, response)
|
|||
}
|
||||
}
|
||||
|
||||
response.end(payload.replace('{{', '[{').replace('}}', '}]'));
|
||||
payload = payload.replace('{{', '[{').replace('}}', '}]');
|
||||
|
||||
if (payload.charAt(0) != '[')
|
||||
{
|
||||
payload = '[' + payload + ']';
|
||||
}
|
||||
|
||||
response.end(payload + '\n');
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue