From bf5238dd56b6dfe9ee2f1d629d017b2075750663 Mon Sep 17 00:00:00 2001 From: David Eisinger Date: Sun, 4 Feb 2024 15:41:42 -0500 Subject: [PATCH] Check for file before decrypt/dither --- bin/dither/dither.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/dither/dither.rb b/bin/dither/dither.rb index 3e14796..eec3786 100644 --- a/bin/dither/dither.rb +++ b/bin/dither/dither.rb @@ -9,6 +9,8 @@ DITHER = ENV["DITHER"] != "0" FORMAT = DITHER ? "png" : "webp" get "/*" do |path| + halt 404, {"Content-Type" => "text/plain"}, "not found" unless File.exist?("#{ROOT}/#{path}.enc") + content_type "image/#{FORMAT}" geometry = params["geo"] unless params["geo"] == ""