mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-21 16:27:18 +02:00
Raise portable import body limit
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
24748de421
commit
e0dae3c68b
3 files changed
+18
-1
No files matched your search
@@ -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
@@ -59,6 +59,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;
|
||||
@@ -139,7 +140,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;
|
||||
},
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
export const PORTABLE_JSON_BODY_LIMIT = "64mb";
|
||||
export const PORTABLE_JSON_BODY_LIMIT_BYTES = 64 * 1024 * 1024;
|
||||
Reference in new issue
Block a user