diff options
Diffstat (limited to 'config/initializers/trusted_proxies.rb')
-rw-r--r-- | config/initializers/trusted_proxies.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/config/initializers/trusted_proxies.rb b/config/initializers/trusted_proxies.rb index ca2eed664ed..7af465d8443 100644 --- a/config/initializers/trusted_proxies.rb +++ b/config/initializers/trusted_proxies.rb @@ -26,12 +26,10 @@ Rails.application.config.action_dispatch.trusted_proxies = ( # A monkey patch to make trusted proxies work with Rails 5.0. # Inspired by https://github.com/rails/rails/issues/5223#issuecomment-263778719 # Remove this monkey patch when upstream is fixed. -if Gitlab.rails5? - module TrustedProxyMonkeyPatch - def ip - @ip ||= (get_header("action_dispatch.remote_ip") || super).to_s - end +module TrustedProxyMonkeyPatch + def ip + @ip ||= (get_header("action_dispatch.remote_ip") || super).to_s end - - ActionDispatch::Request.send(:include, TrustedProxyMonkeyPatch) end + +ActionDispatch::Request.send(:include, TrustedProxyMonkeyPatch) |