|
|
@ -18,7 +18,8 @@ module Goldfinger
|
|
|
|
def self.finger(uri, opts = {})
|
|
|
|
def self.finger(uri, opts = {})
|
|
|
|
to_hidden = /\.(onion|i2p)(:\d+)?$/.match(uri)
|
|
|
|
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
|
|
|
|
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
|
|
|
|
Goldfinger::Client.new(uri, opts).finger
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|