1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

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

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