Fix access to arbitrary .png files on ruby 1.8

This commit is contained in:
Jeremy Evans 2015-01-05 13:19:54 -08:00
parent 6ce8a94005
commit e727b17930
1 changed files with 1 additions and 1 deletions

View File

@ -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