Skip to content

feat: make max request size configurable - #14

Merged
TorstenDittmann merged 3 commits into
mainfrom
torsten/configurable-max-request-size-00e3
Sep 14, 2026
Merged

TorstenDittmann merged 3 commits into
mainfrom
torsten/configurable-max-request-size-00e3

Conversation

@TorstenDittmann

Copy link
Copy Markdown
Contributor

The /analyze body limit was hardcoded at 10 MiB. It is now set with MAX_REQUEST_SIZE so operators can raise or lower it without rebuilding.

Default: 10MiB (10485760 bytes), including multipart overhead.

Examples:

# default remains 10 MiB
./autogravity

# larger uploads
MAX_REQUEST_SIZE=32MiB ./autogravity

# exact byte count
MAX_REQUEST_SIZE=10485760 ./autogravity

Accepted values are a positive integer (bytes) or a size with a KiB/MiB/GiB or KB/MB/GB suffix. Oversized requests still return 413, with the configured limit in the error message.

Decoded-image megapixel limits are unchanged.

Open in Web Open in Cursor 

Expose the previously hardcoded 10 MiB /analyze body limit as
MAX_REQUEST_SIZE so operators can raise or lower it without rebuilding.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
@appwrite

appwrite Bot commented Sep 14, 2026

Copy link
Copy Markdown

Autogravity

Project ID: 6a9e5d640016fa6fb653

Sites (1)
Site Status Logs Preview QR
 Docs
autogravity-docs
Ready Ready View Logs Preview URL QR Code

Tip

Schedule functions to run as often as every minute with cron expressions

@TorstenDittmann
TorstenDittmann marked this pull request as ready for review September 14, 2026 19:17
@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge because no unresolved blocking behavior or accepted new finding remains.

Summary

  • Parses positive byte counts and common decimal or binary size suffixes.
  • Applies the configured limit to request-body enforcement and reports it in oversized-request errors and startup logs.
  • Adds behavior-level request-limit tests and documents the setting in the README and documentation site.

Reviews (2) · Last reviewed commit: "fix: keep configured request size as int..."

Comment thread cmd/autogravity/main_test.go Outdated
cursoragent and others added 2 commits September 14, 2026 19:25
Read the limit from the environment when constructing the app, and replace
helper-level parser and formatter assertions with request-status checks.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
Untyped default assignment inferred int and broke the constructor.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
@TorstenDittmann
TorstenDittmann merged commit d4b0e27 into main Sep 14, 2026
5 checks passed
@TorstenDittmann
TorstenDittmann deleted the torsten/configurable-max-request-size-00e3 branch September 14, 2026 19:32
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.

2 participants