webfinger is now not washington specific
This commit is contained in:
parent
99f7e938fd
commit
3d87c111df
3 changed files with 14 additions and 1 deletions
|
|
@ -81,6 +81,13 @@ class User < Person
|
|||
self == post.person
|
||||
end
|
||||
|
||||
def terse_url
|
||||
terse= self.url.gsub(/https?:\/\//, '')
|
||||
terse.gsub!(/www\./, '')
|
||||
terse = terse.chop! if terse[-1, 1] == '/'
|
||||
terse
|
||||
end
|
||||
|
||||
def do_bad_things
|
||||
self.password_confirmation = self.password
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
|
||||
xmlns:hm='http://host-meta.net/xrd/1.0'>
|
||||
<hm:Host>washington.joindiaspora.com</hm:Host>
|
||||
<hm:Host><%= @user.terse_url %></hm:Host>
|
||||
<Link rel='lrdd'
|
||||
template='<%=@user.url%>webfinger?q={uri}'>
|
||||
<Title>Resource Descriptor</Title>
|
||||
|
|
|
|||
|
|
@ -41,4 +41,10 @@ describe User do
|
|||
@user.send_friend_request_to( @friend.url ).should be nil
|
||||
end
|
||||
|
||||
|
||||
it 'should be able to give me the terse url for webfinger' do
|
||||
user = Factory.create(:user)
|
||||
user.terse_url.should == 'example.com'
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue