about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorJenkins <jenkins@jenkins.ninjawedding.org>2018-05-18 00:17:23 +0000
committerJenkins <jenkins@jenkins.ninjawedding.org>2018-05-18 00:17:23 +0000
commit4c0770d6c8dac8177b8891a6fb97ccf440100fc2 (patch)
tree9d71c9189635be02b4ef344c18f3b86b7a936c02 /config
parent2636a23092306bdb07250add02d2851476d58bc2 (diff)
parent919eef309820a421d6f5886b8ae811d3924cea97 (diff)
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'config')
-rw-r--r--config/initializers/http_client_proxy.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/config/initializers/http_client_proxy.rb b/config/initializers/http_client_proxy.rb
index f5026d59e..52c595c5d 100644
--- a/config/initializers/http_client_proxy.rb
+++ b/config/initializers/http_client_proxy.rb
@@ -18,7 +18,8 @@ module Goldfinger
   def self.finger(uri, opts = {})
     to_hidden = /\.(onion|i2p)(:\d+)?$/.match(uri)
     raise Mastodon::HostValidationError, 'Instance does not support hidden service connections' if !Rails.configuration.x.access_to_hidden_service && to_hidden
-    opts = opts.merge(Rails.configuration.x.http_client_proxy).merge(ssl: !to_hidden)
+    opts = { ssl: !to_hidden, headers: {} }.merge(Rails.configuration.x.http_client_proxy).merge(opts)
+    opts[:headers]['User-Agent'] ||= Mastodon::Version.user_agent
     Goldfinger::Client.new(uri, opts).finger
   end
 end