diff options
author | Cameron Bothner <cameronbothner@gmail.com> | 2018-08-18 14:03:52 -0400 |
---|---|---|
committer | Cameron Bothner <cameronbothner@gmail.com> | 2018-08-21 15:35:58 -0400 |
commit | 22efb2ec49087827ca1cb28a8bad9f016800c591 (patch) | |
tree | 4b6ec860a38657b99d24d95a3a9f60fe7ef5943c /activestorage/app | |
parent | 5cd2d07bdcda4b2f547830d2becafe5e0722fa43 (diff) | |
download | rails-22efb2ec49087827ca1cb28a8bad9f016800c591.tar.gz rails-22efb2ec49087827ca1cb28a8bad9f016800c591.tar.bz2 rails-22efb2ec49087827ca1cb28a8bad9f016800c591.zip |
Respond with 404 in ActiveStorage::DiskController#show when file missing
`ActiveStorage::DiskController#show` generates a 404 Not Found response when
the requested file is missing from the disk service. It previously raised
`Errno::ENOENT`.
Diffstat (limited to 'activestorage/app')
-rw-r--r-- | activestorage/app/controllers/active_storage/disk_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activestorage/app/controllers/active_storage/disk_controller.rb b/activestorage/app/controllers/active_storage/disk_controller.rb index 75cc11d6ff..7bd641ab9a 100644 --- a/activestorage/app/controllers/active_storage/disk_controller.rb +++ b/activestorage/app/controllers/active_storage/disk_controller.rb @@ -13,6 +13,8 @@ class ActiveStorage::DiskController < ActiveStorage::BaseController else head :not_found end + rescue Errno::ENOENT + head :not_found end def update |