Use default middleware for parsing request body

This commit is contained in:
Cohee
2025-03-10 00:48:58 +02:00
parent 64206d6f47
commit 67d013e40a
44 changed files with 252 additions and 297 deletions

View File

@ -9,7 +9,6 @@ import sanitize from 'sanitize-filename';
import { sync as writeFileAtomicSync } from 'write-file-atomic';
import { getConfigValue, color } from '../util.js';
import { jsonParser } from '../express-common.js';
import { write } from '../character-card-parser.js';
const contentDirectory = path.join(process.cwd(), 'default/content');
@ -627,7 +626,7 @@ function isHostWhitelisted(host) {
export const router = express.Router();
router.post('/importURL', jsonParser, async (request, response) => {
router.post('/importURL', async (request, response) => {
if (!request.body.url) {
return response.sendStatus(400);
}
@ -713,7 +712,7 @@ router.post('/importURL', jsonParser, async (request, response) => {
}
});
router.post('/importUUID', jsonParser, async (request, response) => {
router.post('/importUUID', async (request, response) => {
if (!request.body.url) {
return response.sendStatus(400);
}