Skip to content

Static binary assets are not served correctly when they have capital letters in extension #1508

@lonelyelk

Description

@lonelyelk

When serving static binary assets configured with:

files: [
    ...
    {pattern: './fixtures/images/*.jpg', included: false, served: true},
    {pattern: './fixtures/images/*.JPG', included: false, served: true},
    ...
]

Only images with *.jpg extensions are served properly. Capital letters extension shows a 'broken image' icon. This seems to be due to not recognising said image as a binary file. Adding "JPG" to lib/binary-extensions.json or modifying lib/preprocessor.js condition like so:

var thisFileIsBinary = isBinary[path.extname(file.originalPath).toLowerCase()]

Solves the problem.

Not sure how to write a failing test for this to submit a fix.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions