Skip to content

fix: clean up downloaded zip files#24

Open
pupuking723 wants to merge 1 commit into
silexlabs:mainfrom
pupuking723:fix/download-zip-cleanup
Open

fix: clean up downloaded zip files#24
pupuking723 wants to merge 1 commit into
silexlabs:mainfrom
pupuking723:fix/download-zip-cleanup

Conversation

@pupuking723

Copy link
Copy Markdown

Fixes silexlabs/Silex#1725.

This updates the Download connector route so generated zip files are removed from the OS temp directory after a successful res.sendFile() transfer. Failed downloads keep the zip in place so the user can retry.

It also rejects unsafe :tmpZipFile parameters containing path separators or .., so the download route cannot be used to read files outside the temp directory.

Verification:

  • yarn test src/ts/plugins/server/DownloadConnector.test.ts --runInBand
  • yarn lint --quiet src/ts/plugins/server/DownloadConnector.ts src/ts/plugins/server/DownloadConnector.test.ts
  • yarn build:plugins:server
  • git diff --check

Note: the local pre-commit hook reran yarn install, but that hook failed after the verified checks above because the sandboxed environment could not resolve registry.yarnpkg.com.

@lexoyo

lexoyo commented Jun 14, 2026

Copy link
Copy Markdown
Member

Nice! Thank you @pupuking723 !
I'll take a look very soon :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publication zips from the Download connector are never deleted and fill the server disk

2 participants