lib/rack/tidy/cleaner.rb
def call!(env)
      @env = env.dup
      status, @headers, response = @app.call(@env)      
      if should_clean?
        @headers.delete('Content-Length')
        response = Rack::Response.new(
          tidy_markup(response.respond_to?(:body) ? response.body : response),
          status,
          @headers
        )
        response.finish
        response.to_a
      else
        [status, @headers, response]
      end
    end
def call!(env)
      @env = env.dup
      status, @headers, response = @app.call(@env)      
      if should_clean?
        @headers.delete('Content-Length')
        response = Rack::Response.new(
          tidy_markup(response.respond_to?(:body) ? response.body : response),
          status,
          @headers
        )
        response.finish
        response.to_a
      else
        [status, @headers, response]
      end
    end
def call! ( env ) @env = env . dup status , @headers , response = @app . call ( @env ) if should_clean? @headers . delete ( 'Content-Length' ) response = Rack :: Response . new ( tidy_markup ( response . respond_to? ( :body ) ? response . body : response ) , status , @headers ) response . finish response . to_a else [ status , @headers , response ] end end
thread safe version using shallow copy of env
thread safe version using shallow copy of env