Browse Source

Add guard against DNS rebinding attacks (#16087)

* Add guard against DNS rebinding attacks

* Fix not to apply to test environment
closed-social-v3
Takeshi Umeda 7 months ago
committed by GitHub
parent
commit
8323023464
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      config/initializers/1_hosts.rb

+ 6
- 0
config/initializers/1_hosts.rb View File

@ -26,4 +26,10 @@ Rails.application.configure do
"ws://#{ENV['REMOTE_DEV'] == 'true' ? host.split(':').first : 'localhost'}:4000"
end
end
unless Rails.env.test?
config.hosts << host if host.present?
config.hosts << web_host if web_host.present?
config.hosts << alternate_domains if alternate_domains.present?
end
end

Loading…
Cancel
Save