Skip to content

Commit

Permalink
Ignore reporting 404 when it is likely bots trying to hack wordpress.…
Browse files Browse the repository at this point in the history
… Bots gonna bot.
  • Loading branch information
stefansundin committed Jul 29, 2017
1 parent 704f965 commit 655a8d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/initializers/05-airbrake.rb
Expand Up @@ -7,4 +7,9 @@

use Airbrake::Rack::Middleware
enable :raise_errors

Airbrake.add_filter do |notice|
# Bots gonna bot
notice.ignore! if notice[:errors].any? { |e| e[:type] == "Sinatra::NotFound" } && /\/wp-(?:admin|includes|content|login)/ =~ notice[:context][:url]
end
end

0 comments on commit 655a8d5

Please sign in to comment.