We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2ebab9 commit 4a021dfCopy full SHA for 4a021df
lib/rack/attack/request.rb
@@ -1,6 +1,7 @@
1
# frozen_string_literal: true
2
3
-# Rack::Attack::Request is the same as ::Rack::Request by default.
+# Rack::Attack::Request is the same as :ActionDispatch::Request in Rails apps,
4
+# and ::Rack::Request in other apps by default.
5
#
6
# This is a safe place to add custom helper methods to the request object
7
# through monkey patching:
@@ -15,7 +16,7 @@
15
16
17
module Rack
18
class Attack
- class Request < ::Rack::Request
19
+ class Request < defined?(::ActionDispatch::Request) ? ::ActionDispatch::Request : ::Rack::Request
20
end
21
22
0 commit comments