Skip to content

Commit 04a0050

Browse files
authored
feat(uploads): Increase default fastify body limit to 100MB (#11412)
1 parent 707a2bd commit 04a0050

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.changesets/11412.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- feat(uploads): Increase default fastify body limit to 100MB (#11412) by @dac09
2+
3+
Increases the default limit for receiving requests to 100MB (instead of 15MB). This number is arbitrary really, but it is the TOTAL size of the request, not of each file being uploaded.
4+
5+
The user can override this in their server file.
6+
7+
```jsx
8+
// api/server.js
9+
const server = await createServer({
10+
logger,
11+
fastifyServerOptions: {
12+
bodyLimit: 1048576 * 2, // 2 MiB
13+
},
14+
})
15+
```

packages/api-server/src/createServerHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const DEFAULT_CREATE_SERVER_OPTIONS: DefaultCreateServerOptions = {
5959
},
6060
fastifyServerOptions: {
6161
requestTimeout: 15_000,
62-
bodyLimit: 1024 * 1024 * 15, // 15MB
62+
bodyLimit: 1024 * 1024 * 100, // 100MB
6363
},
6464
configureApiServer: () => {},
6565
parseArgs: true,

0 commit comments

Comments
 (0)