Skip to content

file-type sniffer should never work on more than 8KiB #200

Open
@lidel

Description

@lidel

Ref. https://www.npmjs.com/package/file-type#usage – we should be fine with reading only the magic bytes at the beginning of the file.

file-type can sometimes work with as few as 4 bytes (e.g., for PNGs), some formats (like ISO files) need up to 4100 bytes. A buffer of 8KB (8192 bytes) is probably the ceiling on how much data should we wait for before being able to do the sniffing, passing anything more than that

Right now, the amount of passed data depends on codec-specific plugin. For dag-pb we seem to pass entire block, so the amount of data passed is way to high 256KiB up to 1MiB:

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritization

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions