diff options
author | Giteabot <teabot@gitea.io> | 2023-07-24 10:56:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-24 14:56:13 +0000 |
commit | a424f6d4f8224ca7d5db1a27e1db46a5dc47f30b (patch) | |
tree | 3926a35a1c974f6a5ccca38b0d611287e68b10a7 /routers | |
parent | 59713541b60d52e38244a83c0bbc7d220439d55a (diff) | |
download | gitea-a424f6d4f8224ca7d5db1a27e1db46a5dc47f30b.tar.gz gitea-a424f6d4f8224ca7d5db1a27e1db46a5dc47f30b.zip |
Fix handling of Debian files with trailing slash (#26087) (#26098)
Backport #26087 by @KN4CK3R
Fixes #26022
- Fix handling of files with trailing slash
- Fix handling of duplicate package file errors
- Added test for both
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/packages/debian/debian.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/packages/debian/debian.go b/routers/api/packages/debian/debian.go index 1b3d76ba25..dd0db019d4 100644 --- a/routers/api/packages/debian/debian.go +++ b/routers/api/packages/debian/debian.go @@ -195,7 +195,7 @@ func UploadPackageFile(ctx *context.Context) { ) if err != nil { switch err { - case packages_model.ErrDuplicatePackageVersion: + case packages_model.ErrDuplicatePackageVersion, packages_model.ErrDuplicatePackageFile: apiError(ctx, http.StatusBadRequest, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) |