mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Possible to overwrite trusted proxies list #2769
This commit is contained in:
parent
ff5ee99e40
commit
f0b015bddf
3 changed files with 23 additions and 0 deletions
14
config/initializers/eis_custom_rack.rb
Normal file
14
config/initializers/eis_custom_rack.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
# EIS custom rack hack in order to enable test external interfaces EPP/REPP inside webserver network
|
||||
# rubocop:disable Metrics/LineLength
|
||||
module Rack
|
||||
class Request
|
||||
def trusted_proxy?(ip)
|
||||
if ENV['eis_trusted_proxies']
|
||||
ENV['eis_trusted_proxies'].split(',').map(&:strip).include?(ip)
|
||||
else
|
||||
ip =~ /\A127\.0\.0\.1\Z|\A(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.|\A::1\Z|\Afd[0-9a-f]{2}:.+|\Alocalhost\Z|\Aunix\Z|\Aunix:/i
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
# rubocop:enable Metrics/LineLength
|
Loading…
Add table
Add a link
Reference in a new issue