diff options
author | Azul <azul@leap.se> | 2013-01-22 16:45:01 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-01-22 16:45:01 +0100 |
commit | 40edf176142bd6092f13bd9f9fb72a2c69d4b052 (patch) | |
tree | 918ac6315214f980cc3672b19ac7e6c82cc2306d /users | |
parent | 493dea794285f0874a9235fe14e4350bd53c2a9f (diff) |
fixing xml and adding json representation for host_meta
Diffstat (limited to 'users')
-rw-r--r-- | users/app/views/webfinger/host_meta.xml.erb (renamed from users/app/views/webfinger/host_meta.erb) | 2 | ||||
-rw-r--r-- | users/lib/.webfinger.rb.swp | bin | 12288 -> 0 bytes | |||
-rw-r--r-- | users/lib/webfinger/host_meta_presenter.rb | 9 |
3 files changed, 10 insertions, 1 deletions
diff --git a/users/app/views/webfinger/host_meta.erb b/users/app/views/webfinger/host_meta.xml.erb index 23b4039..37c9d1e 100644 --- a/users/app/views/webfinger/host_meta.erb +++ b/users/app/views/webfinger/host_meta.xml.erb @@ -1,4 +1,4 @@ - <?xml version='1.0' encoding='UTF-8'?> +<?xml version='1.0' encoding='UTF-8'?> <XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'> <Subject><%= @host_meta.subject %></Subject> diff --git a/users/lib/.webfinger.rb.swp b/users/lib/.webfinger.rb.swp Binary files differdeleted file mode 100644 index 09528c6..0000000 --- a/users/lib/.webfinger.rb.swp +++ /dev/null diff --git a/users/lib/webfinger/host_meta_presenter.rb b/users/lib/webfinger/host_meta_presenter.rb index 3901a28..b48729c 100644 --- a/users/lib/webfinger/host_meta_presenter.rb +++ b/users/lib/webfinger/host_meta_presenter.rb @@ -14,4 +14,13 @@ class Webfinger::HostMetaPresenter def webfinger_template(path = 'webfinger', query_param='q') "#{subject}/#{path}?#{query_param}={uri}" end + + def to_json(options) + { + subject: subject, + links: { + lrdd: { type: 'application/xrd+xml', template: webfinger_template } + } + }.to_json(options) + end end |