Skip to content

Commit 3529139

Browse files
committed
WIP
1 parent fb1bfed commit 3529139

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

sentry-rails/lib/sentry/rails/railtie.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
require "sentry/rails/rescued_exception_interceptor"
55
require "sentry/rails/backtrace_cleaner"
66

7+
if RUBY_ENGINE == "jruby" && RUBY_VERSION >= "3.4"
8+
class ActionDispatch::MiddlewareStack::Middleware
9+
def build(app)
10+
if klass == ActionDispatch::RequestId && args[0].is_a?(Hash)
11+
klass.new(app, **(args[0]))
12+
elsif klass == ActionDispatch::Static && args.last.is_a?(Hash) && args.size == 2
13+
klass.new(app, args[0], **(args[1]))
14+
else
15+
klass.new(app, *args, &block)
16+
end
17+
end
18+
end
19+
end
20+
721
module Sentry
822
class Railtie < ::Rails::Railtie
923
# middlewares can't be injected after initialize

0 commit comments

Comments
 (0)