about summary refs log tree commit diff
path: root/app/views/well_known/host_meta/show.xml.ruby
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/well_known/host_meta/show.xml.ruby')
-rw-r--r--app/views/well_known/host_meta/show.xml.ruby16
1 files changed, 12 insertions, 4 deletions
diff --git a/app/views/well_known/host_meta/show.xml.ruby b/app/views/well_known/host_meta/show.xml.ruby
index 07d026471..0a6bdc322 100644
--- a/app/views/well_known/host_meta/show.xml.ruby
+++ b/app/views/well_known/host_meta/show.xml.ruby
@@ -1,5 +1,13 @@
-Nokogiri::XML::Builder.new do |xml|
-  xml.XRD(xmlns: 'http://docs.oasis-open.org/ns/xri/xrd-1.0') do
-    xml.Link(rel: 'lrdd', type: 'application/xrd+xml', template: @webfinger_template)
+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['type']     = 'application/xrd+xml'
+    link['template'] = @webfinger_template
   end
-end.to_xml
+end
+
+('<?xml version="1.0" encoding="UTF-8"?>' + Ox.dump(doc, effort: :tolerant)).force_encoding('UTF-8')