aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/packages/pypi
diff options
context:
space:
mode:
authorNanguan Lin <70063547+lng2020@users.noreply.github.com>2023-10-10 21:39:58 +0800
committerGitHub <noreply@github.com>2023-10-10 15:39:58 +0200
commit5b6258a0b94737ec3db1ce418d0c933512a71f78 (patch)
treed1d1a78491e575734b1a683909d5860c0349a43f /routers/api/packages/pypi
parent2c7b6c378e73665920056b1b20ecd8fdd78f4045 (diff)
downloadgitea-5b6258a0b94737ec3db1ce418d0c933512a71f78.tar.gz
gitea-5b6258a0b94737ec3db1ce418d0c933512a71f78.zip
Fix the wrong HTTP response status code for duplicate packages (#27480)
fix #27470 (hope there is nothing missing 😢 ) --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'routers/api/packages/pypi')
-rw-r--r--routers/api/packages/pypi/pypi.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/packages/pypi/pypi.go b/routers/api/packages/pypi/pypi.go
index 8c7f9bbf38..5718b1203b 100644
--- a/routers/api/packages/pypi/pypi.go
+++ b/routers/api/packages/pypi/pypi.go
@@ -177,7 +177,7 @@ func UploadPackageFile(ctx *context.Context) {
if err != nil {
switch err {
case packages_model.ErrDuplicatePackageFile:
- apiError(ctx, http.StatusBadRequest, err)
+ apiError(ctx, http.StatusConflict, err)
case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize:
apiError(ctx, http.StatusForbidden, err)
default: