Skip to content
oRPC
Esc
navigateopen⌘Jpreview
On this page

Request Limit Plugin

Restricts the size of incoming request bodies to protect the server from oversized payloads.

Setup

Use RequestLimitHandlerPlugin to limit the size of incoming request bodies.

import { RequestLimitHandlerPlugin } from '@orpc/server/plugins'

const handler = new RPCHandler(router, {
  plugins: [
    new RequestLimitHandlerPlugin({
      /**
       * The maximum allowed request body size in bytes.
       */
      maxBodySize: 1024 * 1024, // 1MB
    }),
  ],
})

Learn More

For implementation details, see the source code.

Last updated on August 6, 2026

Was this page helpful?