Skip to content

Image without extension works in Dev environment but raises error in Production #729

Open
@georgeu2000

Description

@georgeu2000

This is a nasty bug that has affected us twice last year and took down Production.

I see a PR was submitted but never merged and there was no explanation if the PR was lacking in some way.

https://github.com/rails/sprockets-rails/pull/461/files

This is currently an issue in Rails: rails/rails#42784
Previous issue in Rails: rails/rails#35651

Expected behavior

If an image is missing extension in Development environment, it should raise Sprockets::Rails::Helper::AssetNotFound error.

<%= image_tag 'image' %>

Actual behavior

If the image is missing extension in Development environment, it renders fine.

However, it raises Sprockets::Rails::Helper::AssetNotFound error in Production environment.

System configuration

sprockets (4.0.2)
sprockets-rails (3.2.2)
Rails 6.0.3.4
ruby 2.7.2p137

Example App (Reproduction) - THIS IS IMPORTANT YOUR ISSUE LIKELY WILL NOT BE RESOLVED WITHOUT THIS

There was an example app provided.

https://github.com/gadikotamohan/image_test

rails/rails#35651 (comment)

A PR has already been created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions