/usr/lib/ruby/vendor_ruby/remotipart/render_overrides.rb is in ruby-remotipart 1.2.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | module Remotipart
# Responder used to automagically wrap any non-xml replies in a text-area
# as expected by iframe-transport.
module RenderOverrides
include ERB::Util
def self.included(base)
base.class_eval do
alias_method_chain :render, :remotipart
end
end
def render_with_remotipart *args
render_without_remotipart *args
if remotipart_submitted?
textarea_body = response.content_type == 'text/html' ? html_escape(response.body) : response.body
response.body = %{<textarea data-type=\"#{response.content_type}\" data-status=\"#{response.response_code}\" data-statusText=\"#{response.message}\">#{textarea_body}</textarea>}
response.content_type = Mime::HTML
end
response_body
end
end
end
|