diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2023-07-24 16:19:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-24 16:19:44 +0200 |
commit | 6aa30af724b73c698b87c24fd5bb7d71b3c37abe (patch) | |
tree | b0a94897d12d26cadf7df07e54e5057fec04aaa2 /routers/api/packages | |
parent | 4211efe8b7a0b38420da5c5d4f287a8d466aedc2 (diff) | |
download | gitea-6aa30af724b73c698b87c24fd5bb7d71b3c37abe.tar.gz gitea-6aa30af724b73c698b87c24fd5bb7d71b3c37abe.zip |
Fix handling of Debian files with trailing slash (#26087)
Fixes #26022
- Fix handling of files with trailing slash
- Fix handling of duplicate package file errors
- Added test for both
Diffstat (limited to 'routers/api/packages')
-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 f7270e0ae0..a6da1a11a8 100644 --- a/routers/api/packages/debian/debian.go +++ b/routers/api/packages/debian/debian.go @@ -187,7 +187,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) |