chore: raise size limit for text/plain requests
This commit is contained in:
parent
1c186450e1
commit
3c99b748dc
@ -17,7 +17,7 @@ const app = express();
|
|||||||
|
|
||||||
app.use(bodyParser.raw());
|
app.use(bodyParser.raw());
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(bodyParser.text());
|
app.use(bodyParser.text({ limit: "4mb" }));
|
||||||
app.use(requestLogger);
|
app.use(requestLogger);
|
||||||
|
|
||||||
app.use("/api", apiRouter);
|
app.use("/api", apiRouter);
|
||||||
|
@ -1091,24 +1091,17 @@ function doAddAllMods() {
|
|||||||
modsAll.length != 0 &&
|
modsAll.length != 0 &&
|
||||||
window.confirm("Are you sure you want to add " + modsAll.length + " mods to your account?")
|
window.confirm("Are you sure you want to add " + modsAll.length + " mods to your account?")
|
||||||
) {
|
) {
|
||||||
// Batch to avoid PayloadTooLargeError
|
$.post({
|
||||||
const batches = [];
|
url: "/api/missionInventoryUpdate.php?" + window.authz,
|
||||||
for (let i = 0; i < modsAll.length; i += 1000) {
|
contentType: "text/plain",
|
||||||
batches.push(modsAll.slice(i, i + 1000));
|
data: JSON.stringify({
|
||||||
}
|
RawUpgrades: modsAll.map(mod => ({
|
||||||
batches.forEach(batch => {
|
ItemType: mod,
|
||||||
$.post({
|
ItemCount: 21 // To fully upgrade certain arcanes
|
||||||
url: "/api/missionInventoryUpdate.php?" + window.authz,
|
}))
|
||||||
contentType: "text/plain",
|
})
|
||||||
data: JSON.stringify({
|
}).done(function () {
|
||||||
RawUpgrades: batch.map(mod => ({
|
updateInventory();
|
||||||
ItemType: mod,
|
|
||||||
ItemCount: 21 // To fully upgrade certain arcanes
|
|
||||||
}))
|
|
||||||
})
|
|
||||||
}).done(function () {
|
|
||||||
updateInventory();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user