Skip to content
Snippets Groups Projects
Commit a2e9e344 authored by Aboobacker MK's avatar Aboobacker MK :three: Committed by Dominic Couture
Browse files

Log error instead to reduce the impact

parent b546ce72
No related branches found
No related tags found
1 merge request!145679Set Global timeout for Regexp to prevent ReDOS
This commit is part of merge request !145679. Comments created here will be created in the context of that merge request.
......@@ -121,6 +121,10 @@ def self.endpoint_id_for_action(action_name)
render plain: e.message, status: :service_unavailable
end
rescue_from Regexp::TimeoutError do |e|
log_exception(e)
end
def redirect_back_or_default(default: root_path, options: {})
redirect_back(fallback_location: default, **options)
end
......
# frozen_string_literal: true
# Timeout if Regular expression takes more than five seconds to compute. This is a conservative value and is to be evaluated later.
# Timeout if Regular expression takes more than five seconds to compute.
# This is a conservative value and is to be evaluated later.
Regexp.timeout = 5.0 if RUBY_VERSION > "3.2"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment