<commit_before>require "permanent_not_found/version"
require "set"

class PermanentNotFound
  BLOCKED_ROUTES = Set.new(
    %w[
      /.git/head
      /.well-known/apple-app-site-association
      /.well-known/assetlinks.json
      /apple-app-site-association
      /autodiscover/autodiscover.xml
      /browserconfig.xml
      /mysqldumper
      /phpmyadmin
      /wordpress/wp-login.php
      /wp-content/plugins/woocommerce/i18n/locale-info.php
      /wp-login.php
    ]
  ).freeze

  CONTENT = '404 Not Found'
  NOT_FOUND_RESPONSE = [
    404, { 'Content-Type' => 'text/html', 'Content-Length' => CONTENT.size.to_s }, [CONTENT]
  ].freeze

  def initialize(app)
    @app = app
  end

  def call(env)
    if BLOCKED_ROUTES.include?(env['PATH_INFO'].downcase)
      NOT_FOUND_RESPONSE<commit_msg>fix bug with freezed response<commit_after>require "permanent_not_found/version"
require "set"

class PermanentNotFound
  BLOCKED_ROUTES = Set.new(
    %w[
      /.git/head
      /.well-known/apple-app-site-association
      /.well-known/assetlinks.json
      /apple-app-site-association
      /autodiscover/autodiscover.xml
      /browserconfig.xml
      /mysqldumper
      /phpmyadmin
      /wordpress/wp-login.php
      /wp-content/plugins/woocommerce/i18n/locale-info.php
      /wp-login.php
    ]
  ).freeze

  CONTENT = '404 Not Found'
  NOT_FOUND_RESPONSE = [
    404, { 'Content-Type' => 'text/html', 'Content-Length' => CONTENT.size.to_s }, [CONTENT]
  ]

  def initialize(app)
    @app = app
  end

  def call(env)
    if BLOCKED_ROUTES.include?(env['PATH_INFO'].downcase)
      NOT_FOUND_RESPONSE
{'fraction_non_alphanumeric': 0.1252336448598131, 'fraction_numerical': 0.009968847352024923, 'mean_word_length': 2.68348623853211, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '486728', 'n_tokens_mistral': 622, 'n_tokens_neox': 589, 'n_words': 88}