<commit_before>
Merb.logger.info("Compiling routes...")
Merb::Router.prepare do
  # RESTful routes
  resources :posts, :controller=>PostController, :identify=>:index
  resources :categories, :controller=>CategoryController
  
  match('/admin').to(:controller=>AdminController) do
    match('/').to(:action=>'index').name(:admin)
    match('/backup(.:format)',:method=>:get).to(:action=>'backup').name(:backup)
    match('/backup(.:format)',:method=>:post).to(:action=>'restore').name(:backup)
    resources :domains, :controller=>DomainController
  end
  match('/',:query_string=>/p=\d+/).to(:controller => 'post_controller', :action =>'show', :id=>'[1]')
  
  #atom & rss feeds
  match('/feed/:action(.xml)').to(:controller=> 'feed_controller').name(:feeds)
  match('/',:query_string=>/feed=rss2/).to(:controller => 'feed_controller', :action =>'rss') #old wordpress format
  
  match('/',:query_string=>/(tag|cat)=/).defer_to do |request, params|
    raise Merb::ControllerExceptions::NotAcceptable, "Query String Unknown: #{request.query_string[0,20]}"
  end
  
  # Adds the required routes for merb-auth using the password slice
  slice(:merb_auth_slice_password, :name_prefix => nil, :path_prefix => "")
  
  match('/static/:page').to(:controller => 'StaticController', :action=>'show').name(:static)<commit_msg>Try to block a few more bad query strings<commit_after>
Merb.logger.info("Compiling routes...")
Merb::Router.prepare do
  # RESTful routes
  resources :posts, :controller=>PostController, :identify=>:index
  resources :categories, :controller=>CategoryController
  
  match('/admin').to(:controller=>AdminController) do
    match('/').to(:action=>'index').name(:admin)
    match('/backup(.:format)',:method=>:get).to(:action=>'backup').name(:backup)
    match('/backup(.:format)',:method=>:post).to(:action=>'restore').name(:backup)
    resources :domains, :controller=>DomainController
  end
  match('/',:query_string=>/p=\d+$/).to(:controller => 'post_controller', :action =>'show', :id=>'[1]')
  
  #atom & rss feeds
  match('/feed/:action(.xml)').to(:controller=> 'feed_controller').name(:feeds)
  match('/',:query_string=>/feed=rss2$/).to(:controller => 'feed_controller', :action =>'rss') #old wordpress format
  
  match('/',:query_string=>/(author|tag|cat|%)=/).defer_to do |request, params|
    raise Merb::ControllerExceptions::NotAcceptable, "Query String Unknown: #{request.query_string[0,20]}"
  end
  
  # Adds the required routes for merb-auth using the password slice
  slice(:merb_auth_slice_password, :name_prefix => nil, :path_prefix => "")
  
  match('/static/:page').to(:controller => 'StaticController', :action=>'show').name(:static)
{'fraction_non_alphanumeric': 0.20912832023943134, 'fraction_numerical': 0.0037411148522259632, 'mean_word_length': 6.168900804289544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1598375', 'n_tokens_mistral': 845, 'n_tokens_neox': 831, 'n_words': 143}