Raise portable import body limit

This commit is contained in:
Dotta committed 2026-05-19 13:54:54 -05:00
1 parent 2c3217bcd3
commit 858fd027ec
3 files changed
+18 -1

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import { describe, expect, it } from "vitest";
import {
PORTABLE_JSON_BODY_LIMIT,
PORTABLE_JSON_BODY_LIMIT_BYTES,
} from "../http/body-limits.js";
describe("HTTP body limits", () => {
it("allows PAP-scale portable import JSON payloads", () => {
expect(PORTABLE_JSON_BODY_LIMIT).toBe("64mb");
expect(PORTABLE_JSON_BODY_LIMIT_BYTES).toBe(64 * 1024 * 1024);
expect(PORTABLE_JSON_BODY_LIMIT_BYTES).toBeGreaterThan(10 * 1024 * 1024);
});
});
+2 -1
View File
@@ -60,6 +60,7 @@ import { pluginRegistryService } from "./services/plugin-registry.js";
import { createHostClientHandlers } from "@paperclipai/plugin-sdk";
import type { BetterAuthSessionResult } from "./auth/better-auth.js";
import { createCachedViteHtmlRenderer } from "./vite-html-renderer.js";
import { PORTABLE_JSON_BODY_LIMIT } from "./http/body-limits.js";
type UiMode = "none" | "static" | "vite-dev";
const FEEDBACK_EXPORT_FLUSH_INTERVAL_MS = 5_000;
@@ -140,7 +141,7 @@ export async function createApp(
app.use(express.json({
// Company import/export payloads can inline full portable packages.
limit: "10mb",
limit: PORTABLE_JSON_BODY_LIMIT,
verify: (req, _res, buf) => {
(req as unknown as { rawBody: Buffer }).rawBody = buf;
},
+2
View File
@@ -0,0 +1,2 @@
export const PORTABLE_JSON_BODY_LIMIT = "64mb";
export const PORTABLE_JSON_BODY_LIMIT_BYTES = 64 * 1024 * 1024;