Handle missing 404 image. Fixes #263

This commit is contained in:
sdogruyol 2016-11-25 22:19:23 +03:00
parent 9e27fb6ba0
commit 92ea55773b
2 changed files with 2 additions and 0 deletions

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -41,6 +41,8 @@ module Kemal
file_path = File.expand_path("lib/kemal/images/#{image}", Dir.current)
if File.exists? file_path
send_file env, file_path
else
halt env, 404
end
end