Skip to content

Add a configurable application-level request body limit #282

Description

@lamenting-hawthorn

Problem

TrueForge does not currently enforce an application-owned request-body size limit. Standalone or directly exposed deployments therefore depend on an external reverse proxy to reject oversized request bodies before JSON or binary parsing.

Proposed scope

  • Add a configurable maximum request-body size with a documented default.
  • Apply the limit consistently before API route parsing.
  • Return a stable JSON 413 Payload Too Large error response.
  • Document the environment variable in .env.example.
  • Add tests for normal, boundary, oversized, and invalid-configuration cases.

Expected behavior

Normal requests remain unchanged. Requests over the configured byte limit fail early and consistently in standalone and multi-replica modes, regardless of reverse-proxy configuration.

Open design question

The default should be large enough for supported file-upload routes while still providing a meaningful application-level bound. It may be appropriate to align it with or exceed the existing sandbox file limit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions