Skip to content

Commit

Permalink
set correct content-type for sinatra's custom images
Browse files Browse the repository at this point in the history
  • Loading branch information
sr authored and rtomayko committed Sep 7, 2008
1 parent 8d10d94 commit 89ce3ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/sinatra.rb
Expand Up @@ -1295,6 +1295,7 @@ def load_default_configuration!
# Called before reloading to perform development specific configuration.
def load_development_configuration!
get '/sinatra_custom_images/:image.png' do
content_type :png
File.read(File.dirname(__FILE__) + "/../images/#{params[:image]}.png")
end

Expand Down Expand Up @@ -1467,5 +1468,6 @@ def to_result(cx, *args)
end
end

mime :xml, 'application/xml'
mime :xml, 'application/xml'
mime :js, 'application/javascript'
mime :png, 'image/png'

0 comments on commit 89ce3ff

Please sign in to comment.