# File lib/relevance/tarantula/rails_integration_proxy.rb, line 59 def patch_response(url, response) if response.code == '404' if File.exist?(static_content_path(url)) case ext = File.extension(url) when /html|te?xt|css|js|jpe?g|gif|psd|png|eps|pdf|ico/ response.headers["type"] = "text/#{ext}" # readable as response.content_type alter_response(response, '200', static_content_file(url)) else log "Skipping unknown type #{url}" end end end # don't count on metaclass taking block, e.g. # http://relevancellc.com/2008/2/12/how-should-metaclass-work response.metaclass.class_eval do include Relevance::CoreExtensions::Response end end