mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-24 18:13:42 +01:00
Override Rack::Request to use the same trusted proxy settings as Rails
This commit is contained in:
parent
67befe5463
commit
61aee0006e
1 changed files with 7 additions and 0 deletions
7
config/initializers/trusted_proxies.rb
Normal file
7
config/initializers/trusted_proxies.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
module Rack
|
||||
class Request
|
||||
def trusted_proxy?(ip)
|
||||
Rails.application.config.action_dispatch.trusted_proxies.any? { |proxy| proxy === ip }
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue