ce6aaed432
There are edge cases where requests to certain hosts timeout when using the vanilla HTTP.rb gem, which the goldfinger gem uses. Now that we no longer need to support OStatus servers, webfinger logic is so simple that there is no point encapsulating it in a gem, so we can just use our own Request class. With that, we benefit from more robust timeout code and IPv4/IPv6 resolution. Fix #14091
12 lines
377 B
Ruby
12 lines
377 B
Ruby
doc = Ox::Document.new(version: '1.0')
|
|
|
|
doc << Ox::Element.new('XRD').tap do |xrd|
|
|
xrd['xmlns'] = 'http://docs.oasis-open.org/ns/xri/xrd-1.0'
|
|
|
|
xrd << Ox::Element.new('Link').tap do |link|
|
|
link['rel'] = 'lrdd'
|
|
link['template'] = @webfinger_template
|
|
end
|
|
end
|
|
|
|
('<?xml version="1.0" encoding="UTF-8"?>' + Ox.dump(doc, effort: :tolerant)).force_encoding('UTF-8')
|