aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-09-16 01:14:36 +0200
committerGitHub <noreply@github.com>2023-09-15 23:14:36 +0000
commitd513628db90415a27e887c3cf349309b3ad44d55 (patch)
tree8e114f7be386831dc54f44732fa741e111a4c823
parente5ec57cd608a81be6e0a6b897b165e9b322ceab4 (diff)
downloadgitea-d513628db90415a27e887c3cf349309b3ad44d55.tar.gz
gitea-d513628db90415a27e887c3cf349309b3ad44d55.zip
Allow empty Conan files (#27092)
Fixes #27090 Looks like the Conan upload process has changed since last year. The empty uploads don't occur anymore.
-rw-r--r--routers/api/packages/conan/conan.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/routers/api/packages/conan/conan.go b/routers/api/packages/conan/conan.go
index 58e1642442..8edbe98b30 100644
--- a/routers/api/packages/conan/conan.go
+++ b/routers/api/packages/conan/conan.go
@@ -326,13 +326,8 @@ func uploadFile(ctx *context.Context, fileFilter container.Set[string], fileKey
}
defer buf.Close()
- if buf.Size() == 0 {
- // ignore empty uploads, second request contains content
- jsonResponse(ctx, http.StatusOK, nil)
- return
- }
-
isConanfileFile := filename == conanfileFile
+ isConaninfoFile := filename == conaninfoFile
pci := &packages_service.PackageCreationInfo{
PackageInfo: packages_service.PackageInfo{
@@ -364,7 +359,7 @@ func uploadFile(ctx *context.Context, fileFilter container.Set[string], fileKey
pfci.Properties[conan_module.PropertyPackageRevision] = pref.RevisionOrDefault()
}
- if isConanfileFile || filename == conaninfoFile {
+ if isConanfileFile || isConaninfoFile {
if isConanfileFile {
metadata, err := conan_module.ParseConanfile(buf)
if err != nil {