<commit_before># encoding: utf-8
require 'spore/middleware'

class Spore
  class Middleware 
    class UserAgent < Spore::Middleware

      def expected_params
        [ :useragent ]
      end

      def process_request(env)
        env['spore.request_headers'] << { 
          :name => "User-Agent", 
          :value => self.useragent 
        }
        return nil
      end

      def process_response(resp, env)
        env
      end

    end
  end 
end
<commit_msg>middleware/useragent: Must return resp instead of env.<commit_after># encoding: utf-8
require 'spore/middleware'

class Spore
  class Middleware 
    class UserAgent < Spore::Middleware

      def expected_params
        [ :useragent ]
      end

      def process_request(env)
        env['spore.request_headers'] << { 
          :name => "User-Agent", 
          :value => self.useragent 
        }
        return nil
      end

      def process_response(resp, env)
        resp
      end

    end
  end 
end

{'fraction_non_alphanumeric': 0.0845213849287169, 'fraction_numerical': 0.002036659877800407, 'mean_word_length': 1.8997050147492625, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '1665797', 'n_tokens_mistral': 302, 'n_tokens_neox': 287, 'n_words': 74}