Skip to content

Commit 5d8f25d

Browse files
dirkwadirkwa
andauthored
fix(logfiles): use sendZip for /ziplogs to fix res.zip 500 (#2795)
The /skServer/ziplogs handler still called res.zip(), the API of the removed express-easy-zip middleware. Since that dependency is gone, res.zip is undefined at request time, so 'Get all logs in one ZIP file' fails with TypeError: res.zip is not a function (HTTP 500). Migrate the call site to the archiver-based sendZip() helper, mirroring the existing backup-download path in serverroutes.ts. This was the sole remaining res.zip caller in the tree. Co-authored-by: dirkwa <dirkwahrtheit@gmail.com>
1 parent 982f5be commit 5d8f25d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/interfaces/logfiles.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const moment = require('moment')
1818
const path = require('path')
1919
const { getFullLogDir, listLogFiles } = require('@signalk/streams/logging')
2020
import { SERVERROUTESPREFIX } from '../constants'
21+
import { sendZip } from '../zip'
2122

2223
module.exports = function (app) {
2324
return {
@@ -81,7 +82,7 @@ function mountApi(app) {
8182
const sanitizedBoatName = boatName.replace(/\W/g, '_')
8283
const zipFileName = `sk-logs-${sanitizedBoatName}-${moment().format('YYYY-MM-DD-HH-mm')}`
8384

84-
res.zip({
85+
sendZip(res, {
8586
files: [{ path: getFullLogDir(app), name: zipFileName }],
8687
filename: zipFileName + '.zip'
8788
})

0 commit comments

Comments
 (0)