update request limit stuff

This commit is contained in:
Sainan 2025-01-24 16:06:43 +01:00
parent 6ac2cb8456
commit 14f958041f
3 changed files with 4 additions and 4 deletions

View File

@ -16,8 +16,8 @@ import { webuiRouter } from "@/src/routes/webui";
const app = express(); const app = express();
app.use(bodyParser.raw()); app.use(bodyParser.raw());
app.use(express.json()); app.use(express.json({ limit: "4mb" }));
app.use(bodyParser.text({ limit: "4mb" })); app.use(bodyParser.text());
app.use(requestLogger); app.use(requestLogger);
app.use("/api", apiRouter); app.use("/api", apiRouter);

View File

@ -7,7 +7,7 @@ import { RequestHandler } from "express";
export const importController: RequestHandler = async (req, res) => { export const importController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req); const accountId = await getAccountIdForRequest(req);
const request = JSON.parse(String(req.body)) as IImportRequest; const request = req.body as IImportRequest;
const inventory = await getInventory(accountId); const inventory = await getInventory(accountId);
importInventory(inventory, request.inventory); importInventory(inventory, request.inventory);

View File

@ -1094,7 +1094,7 @@ function doImport() {
revalidateAuthz(() => { revalidateAuthz(() => {
$.post({ $.post({
url: "/custom/import?" + window.authz, url: "/custom/import?" + window.authz,
contentType: "text/plain", contentType: "application/json",
data: JSON.stringify({ data: JSON.stringify({
inventory: JSON.parse($("#import-inventory").val()) inventory: JSON.parse($("#import-inventory").val())
}) })