Skip to content

Commit

Permalink
Add global Regexp timeout (mastodon#31928)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored and nileane committed Sep 17, 2024
1 parent c0b1120 commit 4ad8cbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/initializers/regexp.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

# 0.5s is a fairly high timeout, but that should account for slow servers under load
Regexp.timeout = 0.5 if Regexp.respond_to?(:timeout=)

0 comments on commit 4ad8cbd

Please sign in to comment.