Use single POST for attachment uploads #5912

Closed
opened 2025-11-02 06:40:06 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @silverwind on GitHub (Aug 29, 2020).

Attachments currently use 2 POST requests (one for the textual content and one for attachments) which is not ideal because we can not do proper verification like file types in the /attachment endpoint as there is no Repo context in that handler. Those two should be reduced to one POST with Repo context.

Also I think when a user adds an attachment, it is uploaded before the release/comment is actually saved making it possible that orphaned files will linger on the server.

Originally created by @silverwind on GitHub (Aug 29, 2020). Attachments currently use 2 POST requests (one for the textual content and one for attachments) which is not ideal because we can not do proper verification like file types in the `/attachment` endpoint as there is no Repo context in that handler. Those two should be reduced to one POST with Repo context. Also I think when a user adds an attachment, it is uploaded before the release/comment is actually saved making it possible that orphaned files will linger on the server.
GiteaMirror added the issue/stale label 2025-11-02 06:40:06 -06:00
Author
Owner

@stale[bot] commented on GitHub (Nov 9, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Nov 9, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@silverwind commented on GitHub (Nov 9, 2020):

I don't remember the details but I think this was at least partially solved by https://github.com/go-gitea/gitea/issues/12633.

@silverwind commented on GitHub (Nov 9, 2020): I don't remember the details but I think this was at least partially solved by https://github.com/go-gitea/gitea/issues/12633.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5912