lib/rails_mini_profiler/badge.rb
def render
      content_type = @original_response.headers['Content-Type']
      return @original_response unless content_type =~ %r{text/html}

      return @original_response unless @configuration.ui.badge_enabled

      modified_response = Rack::Response.new([], @original_response.status, @original_response.headers)
      modified_response.write(modified_body)
      modified_response.finish

      response = @original_response.response
      response.close if response.respond_to?(:close)

      ResponseWrapper.new(@original_response.status,
                          @original_response.headers,
                          modified_response)
    end
# Inject the badge into the response
#
# @return [ResponseWrapper] The modified response
Inject the badge into the response
Inject the badge into the response
def render
      content_type = @original_response.headers['Content-Type']
      return @original_response unless content_type =~ %r{text/html}
      return @original_response unless @configuration.ui.badge_enabled
      modified_response = Rack::Response.new([], @original_response.status, @original_response.headers)
      modified_response.write(modified_body)
      modified_response.finish
      response = @original_response.response
      response.close if response.respond_to?(:close)
      ResponseWrapper.new(@original_response.status,
                          @original_response.headers,
                          modified_response)
    end
def render content_type = @original_response . headers [ 'Content-Type' ] return @original_response unless content_type =~ %r{ text/html } return @original_response unless @configuration . ui . badge_enabled modified_response = Rack :: Response . new ( [ ] , @original_response . status , @original_response . headers ) modified_response . write ( modified_body ) modified_response . finish response = @original_response . response response . close if response . respond_to? ( :close ) ResponseWrapper . new ( @original_response . status , @original_response . headers , modified_response ) end
Inject the badge into the response
Inject the badge into the response
The modified response
The modified response
ResponseWrapper