Skip to content

Avoid hanging when parsing a partial Gunzip file#783

Merged
sindresorhus merged 2 commits intomainfrom
resolve-parsing-partial-gunzip
Nov 19, 2025
Merged

Avoid hanging when parsing a partial Gunzip file#783
sindresorhus merged 2 commits intomainfrom
resolve-parsing-partial-gunzip

Conversation

@Borewit
Copy link
Collaborator

@Borewit Borewit commented Nov 19, 2025

Changes:

  • Avoid hanging when parsing a partial Gunzip file, by switching to @tokenizer/inflate@0.4..1, which replace fflate with DecompressionStream
  • Avoid cancellation a stream, in occasion of an error.
  • Fall back on gunzip type, in case the data could not be inflated.

If you're adding support for a new file type, please follow the below steps:

Resolves #782

@Borewit Borewit self-assigned this Nov 19, 2025
@Borewit Borewit added the bug label Nov 19, 2025
@Borewit Borewit requested a review from sindresorhus November 19, 2025 11:54
Changes:
- Avoid hanging when parsing a partial Gunzip file
- Avoid cancellation a stream, in occasion of an error.
- Fall back on gunzip type, in case the data could not be inflated.
@Borewit Borewit force-pushed the resolve-parsing-partial-gunzip branch from ef0a3bb to 37ce320 Compare November 19, 2025 11:55
@sindresorhus sindresorhus merged commit 710e053 into main Nov 19, 2025
6 checks passed
@sindresorhus sindresorhus deleted the resolve-parsing-partial-gunzip branch November 19, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detecting gz files hangs forever

2 participants