If we request a bogus image file, Rails generates an internal 500 server error instead of a 404. See the log below.
Here is the line in routes.rb that catches 404s:
# Catches all 404 errors and redirects
match '*url' => 'default#error_404'
Other unknown URLs are handled correctly with 404s. What is different for image files and URLs with file extensions?
Started GET "/images/doesnotexistyo.png" for 71.198.44.101 at 2013-03-08 07:59:24 +0300
Processing by DefaultController#error_404 as PNG
Parameters: {"url"=>"images/doesnotexistyo"}
Completed 500 Internal Server Error in 1ms
ActionView::MissingTemplate (Missing template default/error_404, application/error_404 with {:locale=>[:en], :formats=>[:png], :handlers=>[:erb, :builder]}. Searched in:
* "/home/prod/Prod/app/views"