logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 61aee0006eec95f47ca0a0c75f3ccf4151516b4a
parent: 67befe546342c58f1a16bdb08b6a2ef438e83d57
Author: Eugen Rochko <eugen@zeonfederated.com>
Date:   Sun, 22 Jan 2017 21:01:28 +0100

Override Rack::Request to use the same trusted proxy settings as Rails

Diffstat:

Aconfig/initializers/trusted_proxies.rb7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/config/initializers/trusted_proxies.rb b/config/initializers/trusted_proxies.rb @@ -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