Skip to content

Commit

Permalink
Add guard against DNS rebinding attacks (mastodon#16087)
Browse files Browse the repository at this point in the history
* Add guard against DNS rebinding attacks

* Fix not to apply to test environment
  • Loading branch information
noellabo authored Apr 21, 2021
1 parent e243092 commit 8323023
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/initializers/1_hosts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@
"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

0 comments on commit 8323023

Please sign in to comment.