Use JSON instead of json5

This commit is contained in:
Xrystal 2023-10-21 18:56:51 +08:00
parent 6f0f420063
commit 1d38109dcf
1 changed files with 1 additions and 1 deletions

View File

@ -713,7 +713,7 @@ app.post("/getchat", jsonParser, function (request, response) {
const lines = data.split('\n');
// Iterate through the array of strings and parse each line as JSON
const jsonData = lines.map(tryParse).filter(x => x);
const jsonData = lines.map((l) => { try { return JSON.parse(l); } catch (_) { }}).filter(x => x);
return response.send(jsonData);
} catch (error) {
console.error(error);