<commit_before>require "active_asset/storage"
require "mini_magick"

module ActiveAsset
  class Rack
    def call(env)
      response = ::Rack::Response.new

      begin
        hash = decode_h_param(env)
        set_response_body(response, hash)

        response["ETag"] = digest_body(response.body)
        response["Cache-Control"] = "public, max-age=3600"
      rescue Serializer::DecodeError
        response.status = 400<commit_msg>we can use Rack::ETag here<commit_after>require "active_asset/storage"
require "mini_magick"

module ActiveAsset
  class Rack
    def call(env)
      response = ::Rack::Response.new

      begin
        hash = decode_h_param(env)
        set_response_body(response, hash)
      rescue Serializer::DecodeError
        response.status = 400
{'fraction_non_alphanumeric': 0.09395109395109395, 'fraction_numerical': 0.01287001287001287, 'mean_word_length': 3.2282608695652173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5751911', 'n_tokens_mistral': 245, 'n_tokens_neox': 233, 'n_words': 50}