Attachment size limit in app.ini not enforced for REST API uploads #14971

Closed
opened 2025-11-02 11:27:00 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @SmartVDS on GitHub (Sep 18, 2025).

Description

When using the REST API to upload attachments (e.g. to Pull Requests), the configured file size limits in app.ini are not enforced and the attachments > 1 MB are being uploaded. The same limits are enforced correctly in the web UI.

Configuration snippet

[attachment]
| MAX_SIZE = 1

Gitea Version

1.24.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

git version 2.49.1

Operating System

No response

How are you running Gitea?

We are self-hosting Gitea using Docker (official gitea/gitea image) in ubuntu 22.04 linux server.

Database

SQLite

Originally created by @SmartVDS on GitHub (Sep 18, 2025). ### Description When using the REST API to upload attachments (e.g. to Pull Requests), the configured file size limits in app.ini are not enforced and the attachments > 1 MB are being uploaded. The same limits are enforced correctly in the web UI. Configuration snippet [attachment] | MAX_SIZE = 1 ### Gitea Version 1.24.5 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version git version 2.49.1 ### Operating System _No response_ ### How are you running Gitea? We are self-hosting Gitea using Docker (official gitea/gitea image) in ubuntu 22.04 linux server. ### Database SQLite
GiteaMirror added the topic/apitype/bug labels 2025-11-02 11:27:00 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14971