require File.join(File.dirname(__FILE__), 'string_replacer') module Jangle class StringReplacingResponseBodyFilter include StringReplacer # Do string replacements on the response body and # reset the content length def filter(http_response) data = http_response.body data = do_replacements(data) http_response.content_length = data.length http_response.body = data end end end