~cytrogen/masto-fe

ref: 0dfc6ea3effd8ee118c6b23b0a70588736ca33e6 masto-fe/app/views/well_known/host_meta/show.xml.ruby -rw-r--r-- 488 bytes
0dfc6ea3 — Claire Merge pull request #2365 from ClearlyClaire/glitch-soc/merge-upstream 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

doc = Ox::Document.new(version: '1.0')

ins = Ox::Instruct.new(:xml).tap do |instruct|
  instruct[:version] = '1.0'
  instruct[:encoding] = 'UTF-8'
end

doc << ins

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

Ox.dump(doc, effort: :tolerant).force_encoding('UTF-8')