<commit_before>class MockRequestsController < ApplicationController

  # no CSRF checks on #show
  skip_before_filter :verify_authenticity_token, :only => [:show]

  def show
    mock = Mock.find( id: params[:id])

    mockreq = MockRequest.new(
        remote_address: request.remote_ip,
        method: request.method,
        # headers sent from client as prefixed with HTTP_ and we only want to store those and remove the HTTP_ for storing
        headers: Hash[request.headers.env.select{|h,_| h =~ /^HTTP_(.+)/ }.map{|k,v| [k.match(/^HTTP_(.+)/)[1],v.to_s]}],
        contenttype: request.content_type,<commit_msg>remove deprecation<commit_after>class MockRequestsController < ApplicationController

  # no CSRF checks on #show
  skip_before_action :verify_authenticity_token, :only => [:show]

  def show
    mock = Mock.find( id: params[:id])

    mockreq = MockRequest.new(
        remote_address: request.remote_ip,
        method: request.method,
        # headers sent from client as prefixed with HTTP_ and we only want to store those and remove the HTTP_ for storing
        headers: Hash[request.headers.env.select{|h,_| h =~ /^HTTP_(.+)/ }.map{|k,v| [k.match(/^HTTP_(.+)/)[1],v.to_s]}],
        contenttype: request.content_type,
{'fraction_non_alphanumeric': 0.12530120481927712, 'fraction_numerical': 0.001606425702811245, 'mean_word_length': 3.6492537313432836, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '122199', 'n_tokens_mistral': 398, 'n_tokens_neox': 380, 'n_words': 106}