no json
This commit is contained in:
parent
e603112606
commit
e20f2c24ff
1 changed files with 1 additions and 6 deletions
|
@ -13,12 +13,7 @@ export default async function handler(req, res) {
|
||||||
}
|
}
|
||||||
console.log(req.body);
|
console.log(req.body);
|
||||||
let dat;
|
let dat;
|
||||||
try {
|
dat = req.body;
|
||||||
dat = JSON.parse(req.body).ByteData || req.body.ByteData;
|
|
||||||
} catch (e) {
|
|
||||||
res.status(400).json({error: "ByteData is not a string or undefined"});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (typeof dat !== "string" || typeof dat == "undefined") {
|
if (typeof dat !== "string" || typeof dat == "undefined") {
|
||||||
res.status(400).json({error: "ByteData is not a string or undefined"});
|
res.status(400).json({error: "ByteData is not a string or undefined"});
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue