Check for file before decrypt/dither

This commit is contained in:
David Eisinger
2024-02-04 15:41:42 -05:00
parent ec8e8b91d4
commit bf5238dd56

View File

@@ -9,6 +9,8 @@ DITHER = ENV["DITHER"] != "0"
FORMAT = DITHER ? "png" : "webp" FORMAT = DITHER ? "png" : "webp"
get "/*" do |path| get "/*" do |path|
halt 404, {"Content-Type" => "text/plain"}, "not found" unless File.exist?("#{ROOT}/#{path}.enc")
content_type "image/#{FORMAT}" content_type "image/#{FORMAT}"
geometry = params["geo"] unless params["geo"] == "" geometry = params["geo"] unless params["geo"] == ""