Skip to content

Detecting gz files hangs forever #782

@achingbrain

Description

@achingbrain

Description

The bytes passed to fileTypeFromBuffer in the test below are enough to identify the file in 21.0.0 but in 21.1.0 cause the test to hang and time out:

test('can detect .gz file type', async t => {
	const buf = Uint8Array.from([31, 139, 8, 8, 137, 83, 29, 82, 0, 11]);
	const type = await fileTypeFromBuffer(buf);

	t.deepEqual(type, {
		ext: 'gz',
		mime: 'application/gzip',
	});
});

Existing Issue Check

  • I have searched the existing issues and could not find any related to my problem.

ESM (ECMAScript Module) Requirement Acknowledgment

  • My project is an ESM project and my package.json contains the following entry: "type": "module".

File-Type Scope Acknowledgment

  • I understand that file-type detects binary file types and not text or other formats.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions