From 88b4737500750068cc4102f341b45d621e4adef8 Mon Sep 17 00:00:00 2001 From: Serdar Dogruyol Date: Mon, 19 Mar 2018 22:44:24 +0300 Subject: [PATCH] Don't serve 404 image dynamically --- src/kemal.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kemal.cr b/src/kemal.cr index 1574fac..13880ea 100644 --- a/src/kemal.cr +++ b/src/kemal.cr @@ -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