Revert "remove body parser settings for now"

This reverts commit 41ce22aa1c.
This commit is contained in:
cutestnekoaqua 2023-02-11 00:15:28 +01:00
parent 004d8f18fa
commit 5d33c34aa8
No known key found for this signature in database
GPG Key ID: 6BF0964A5069C1E0

View File

@ -40,7 +40,14 @@ app.use(async (ctx, next) => {
app.use(formidable()); app.use(formidable());
app.use( app.use(
bodyParser(), bodyParser({
// リクエストが multipart/form-data でない限りはJSONだと見なす
detectJSON: (ctx) =>
!(
ctx.is("multipart/form-data") ||
ctx.is("application/x-www-form-urlencoded")
),
}),
); );
// Init multer instance // Init multer instance