Limits
serverFn({ maxBodyBytes }) raises or lowers the body limit of one function: a call over it is refused before the function runs, and a call under a raised limit reads…
| What | Default | Option | When exceeded |
|---|---|---|---|
| URL of any request | 8192 characters | security.limits.maxUrlLength |
414 |
POST body |
1 MiB | security.limits.maxBodyBytes |
413 |
POST body of one function |
the app's limit | serverFn({ maxBodyBytes }), up to security.limits.maxRouteBodyBytes |
413 in the error envelope; the function does not run |
GET payload (p) |
4096 characters | rpc.maxGetPayloadChars |
414 |
| Answer body | 8 MiB | rpc.maxResponseBytes |
500, reported as SERVER_FN_RESPONSE_TOO_LARGE |
| Answer the stub accepts | 16 Mi characters | none | ServerFnProtocolError |
serverFn({ maxBodyBytes }) raises or lowers the body limit of one function: a call over it is refused before the function
runs, and a call under a raised limit reads a body the app's limit would refuse. A batch (several calls in one request) is
bounded by the app's limit, so call a function that needs a larger body on its own. A declared Content-Length over the
limit is refused before a byte is read; a chunked body is cut off at the limit while it is read.
All of these are options of createHandler, set in
src/entry-server.ts. The input limits protect the server before your code reads anything; the answer limit stops a
function that returns a whole table from filling memory.