diff --git a/console/deploy/console.yaml b/console/deploy/console.yaml index b60330e..8fb20f4 100644 --- a/console/deploy/console.yaml +++ b/console/deploy/console.yaml @@ -52,7 +52,7 @@ spec: serviceAccountName: fission-console containers: - name: console - image: naeel/fission-console:v1.3.54 + image: naeel/fission-console:v1.3.55 imagePullPolicy: Always ports: - containerPort: 8090 diff --git a/console/internal/api/handlers.go b/console/internal/api/handlers.go index 8138234..98ea042 100644 --- a/console/internal/api/handlers.go +++ b/console/internal/api/handlers.go @@ -1333,6 +1333,12 @@ func (s *Server) handleCreateFunctionFromArchive(w http.ResponseWriter, r *http. archiveFilenameCreate = fhCreate.Filename } + // Проверяем magic bytes: zip должен начинаться с PK (0x50 0x4B) + if len(archiveBytes) < 4 || archiveBytes[0] != 0x50 || archiveBytes[1] != 0x4B { + writeJSONError(w, http.StatusBadRequest, "загруженный файл не является zip-архивом (ожидается .zip)") + return + } + nsCtx, nsCancel := context.WithTimeout(r.Context(), 60*time.Second) defer nsCancel() if err := s.nsManager.EnsureUserNS(nsCtx, ns); err != nil { diff --git a/console/ui/index.html b/console/ui/index.html index 4adb451..32a3452 100644 --- a/console/ui/index.html +++ b/console/ui/index.html @@ -102,7 +102,7 @@
NUBES
FISSION CONSOLE
-
v1.3.54
+
v1.3.55
@@ -462,7 +462,7 @@
- v1.3.54 + v1.3.55
diff --git a/console/ui/js/fn-archive.js b/console/ui/js/fn-archive.js index f671810..07118a8 100644 --- a/console/ui/js/fn-archive.js +++ b/console/ui/js/fn-archive.js @@ -42,6 +42,7 @@ async function submitCreateArchive() { if (!lang) throw new Error('language is required'); const archiveFile = document.getElementById('ca-archive-file').files[0]; if (!archiveFile) throw new Error('выберите .zip архив'); + if (!archiveFile.name.toLowerCase().endsWith('.zip')) throw new Error('файл должен быть .zip архивом, не .' + archiveFile.name.split('.').pop()); var fd = new FormData(); fd.append('name', name);