From e727b17930f0b3c1a4e666c5901d45d04f68a2d6 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Mon, 5 Jan 2015 13:19:54 -0800 Subject: [PATCH] Fix access to arbitrary .png files on ruby 1.8 --- lib/sinatra/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index 888ec4fb..5def15e0 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -1906,7 +1906,7 @@ module Sinatra configure :development do get '/__sinatra__/:image.png' do - filename = File.dirname(__FILE__) + "/images/#{params[:image]}.png" + filename = File.dirname(__FILE__) + "/images/#{params[:image].to_i}.png" content_type :png send_file filename end