1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Catch and handle unallowed file type errors in issue attachment API (#30791)

Before, we would just throw 500 if a user passes an attachment that is
not an allowed type. This commit catches this error and throws a 422
instead since this should be considered a validation error.
This commit is contained in:
Kemal Zebari
2024-05-02 09:33:31 -07:00
committed by GitHub
parent 677032d36a
commit 872caa17c0
5 changed files with 78 additions and 2 deletions

View File

@@ -7478,6 +7478,9 @@
"404": {
"$ref": "#/responses/error"
},
"422": {
"$ref": "#/responses/validationError"
},
"423": {
"$ref": "#/responses/repoArchivedError"
}
@@ -8097,6 +8100,9 @@
"404": {
"$ref": "#/responses/error"
},
"422": {
"$ref": "#/responses/validationError"
},
"423": {
"$ref": "#/responses/repoArchivedError"
}