about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2018-02-25 03:16:11 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-02-24 19:16:11 +0100
commit2e8a492e8843aa958c53636b24cf4d344e7ca47d (patch)
treee921f2ad9ecde98d57f7a65ff3d729ff003ec5d4 /config
parent7cb49eaa3aad03b60a1e1620d2f700d6ed2b3ea0 (diff)
Raise Mastodon::HostValidationError when host for HTTP request is private (#6410)
Diffstat (limited to 'config')
-rw-r--r--config/environments/development.rb6
-rw-r--r--config/initializers/sidekiq.rb4
2 files changed, 10 insertions, 0 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 59bc2c3e2..2da407c32 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -85,3 +85,9 @@ Rails.application.configure do
 end
 
 ActiveRecordQueryTrace.enabled = ENV.fetch('QUERY_TRACE_ENABLED') { false }
+
+module PrivateAddressCheck
+  def self.private_address?(*)
+    false
+  end
+end
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index b70784d79..f875fbd95 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -9,6 +9,10 @@ end
 
 Sidekiq.configure_server do |config|
   config.redis = redis_params
+
+  config.server_middleware do |chain|
+    chain.add SidekiqErrorHandler
+  end
 end
 
 Sidekiq.configure_client do |config|