Skip to content

Configure Fiber BodyLimit for knowledge upload endpoint (50MB) #75

Description

@sre-helmcode

Context

The RAG knowledge base upload endpoint (POST /api/knowledge/documents) accepts files up to 50MB. However, Fiber's default BodyLimit is 4MB, which means larger uploads will be silently rejected at the framework level before reaching our validation.

Required Change

Set BodyLimit in the Fiber app config to match our upload limit:

app := fiber.New(fiber.Config{
    BodyLimit: 50 * 1024 * 1024, // 50MB
})

Security Context

Identified during security audit of the RAG feature (MED-1). Without this, legitimate uploads between 4-50MB will fail with a confusing error.

Acceptance Criteria

  • Fiber BodyLimit set to 50MB
  • Test uploading a file >4MB and <50MB succeeds
  • Test uploading a file >50MB is rejected with clear error message

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backendBackend relatedenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions