Don't serve 404 image dynamically

This commit is contained in:
Serdar Dogruyol 2018-03-19 22:44:24 +03:00
parent 6fbad555d0
commit 88b4737500
1 changed files with 3 additions and 3 deletions

View File

@ -48,9 +48,9 @@ module Kemal
end
# This route serves the built-in images for not_found and exceptions.
get "/__kemal__/:image" do |env|
image = env.params.url["image"]
file_path = File.expand_path("lib/kemal/images/#{image}", Dir.current)
get "/__kemal__/404.png" do |env|
file_path = File.expand_path("lib/kemal/images/404.png", Dir.current)
if File.exists? file_path
send_file env, file_path
else