<commit_before>class ProxyStack
  helpers do
    def proxy_request!
      req = case request.request_method
      when "GET"
        Net::HTTP::Get.new(request.path_info)
      end

      resp = Net::HTTP.start(configuration.proxy_domain, configuration.proxy_port) do |h|
        h.request(req)
      end
      self.status = resp.code.to_i
      the_headers = []
      resp.each_header{|h,v| the_headers << [h,v]}
      self.headers.replace(Hash[the_headers])
      resp.body
    end

    def extract_http_headers
      out = {}
      request.env.keys.each do |key|<commit_msg>Adds the normal http methods<commit_after>class ProxyStack
  helpers do
    def proxy_request!
      req = case request.request_method
      when /get/i
        Net::HTTP::Get.new(request.path_info)
      when /post/i
        r = Net::HTTP::Post.new(request.path_info)
        r.body = request.env['rack.input'].read
        request.env['rack.input'].rewind
        r
      when /put/i
        r = Net::HTTP::Put.new(request.path_info)
        r.body = request.env['rack.input'].read
        request.env['rack.input'].rewind
        r
      when /delete/i
        Net::HTTP::Delete.new(request.path_info)
      end

      resp = Net::HTTP.start(configuration.proxy_domain, configuration.proxy_port) do |h|
        h.request(req)
      end
      self.status = resp.code.to_i
      the_headers = []
      resp.each_header{|h,v| the_headers << [h,v]}
      self.headers.replace(Hash[the_headers])
      resp.body
    end

    def extract_http_headers
      out = {}
      request.env.keys.each do |key|
{'fraction_non_alphanumeric': 0.12055837563451777, 'fraction_numerical': 0.0, 'mean_word_length': 2.3411016949152543, 'pattern_counts': {'":': 0, '<': 7, '<?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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3842637', 'n_tokens_mistral': 520, 'n_tokens_neox': 508, 'n_words': 92}