summaryrefslogtreecommitdiff
path: root/users/lib/webfinger/host_meta_presenter.rb
blob: 3901a28142e8c56aeea86a9259727ff69012a579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'uri'

class Webfinger::HostMetaPresenter
  def initialize(request)
    @request = request
  end

  def subject
    url = URI.parse(@request.url)
    url.path = ''
    url.to_s
  end

  def webfinger_template(path = 'webfinger', query_param='q')
    "#{subject}/#{path}?#{query_param}={uri}"
  end
end