Skip to content

feat(api): cap request body at 10 MB with CKAN 413 envelope - #33

Merged
sagargg merged 1 commit into
mainfrom
feat/payload-size-limit
Oct 28, 2026
Merged

sagargg merged 1 commit into
mainfrom
feat/payload-size-limit

Conversation

@sagargg

@sagargg sagargg commented Oct 28, 2026

Copy link
Copy Markdown
Member

BigQuery's jobs.insert request body is hard-capped at 10 MB, so a datastore_create / datastore_upsert whose records (shipped as a single @rows STRING query parameter) overflow that cap fails deep in the engine with a raw HTML 413 and surfaces as a 500. Lower the default MAX_REQUEST_BODY_MB from 50 to 10 so the middleware catches oversize writes at the boundary, and rewrite its 413 to emit the CKAN error envelope ({help, success, error}) with an actionable message naming the actual body size and the configured limit.

BigQuery's `jobs.insert` request body is hard-capped at 10 MB, so a
`datastore_create` / `datastore_upsert` whose records (shipped as a
single `@rows` STRING query parameter) overflow that cap fails deep
in the engine with a raw HTML 413 and surfaces as a 500. Lower the
default `MAX_REQUEST_BODY_MB` from 50 to 10 so the middleware catches
oversize writes at the boundary, and rewrite its 413 to emit the CKAN
error envelope (`{help, success, error}`) with an actionable message
naming the actual body size and the configured limit.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1b285115-c989-47e1-88c6-55629a0679dc
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sagargg
sagargg merged commit 7e949ea into main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant