From 919eef309820a421d6f5886b8ae811d3924cea97 Mon Sep 17 00:00:00 2001 From: MIYAGI Hikaru Date: Fri, 18 May 2018 08:47:22 +0900 Subject: User agent for WebFinger (#7531) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * User agent for WebFinger * local_domain → web_domain * 'http' is away accidentally... --- config/initializers/http_client_proxy.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config/initializers') 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 -- cgit