remove quotes from alias-url from old webfinger xml

This commit is contained in:
Benjamin Neff 2015-08-01 01:20:02 +02:00
parent c46cc39b2a
commit 7b3e6ad0c7
2 changed files with 8 additions and 2 deletions

View file

@ -154,7 +154,7 @@ module DiasporaFederation
new(
acct_uri: data[:subject],
alias_url: data[:aliases].first,
alias_url: clean_alias(data[:aliases].first),
hcard_url: parse_link(links, REL_HCARD),
seed_url: parse_link(links, REL_SEED),
profile_url: parse_link(links, REL_PROFILE),
@ -217,6 +217,12 @@ module DiasporaFederation
element ? element[:href] : nil
end
private_class_method :parse_link
# @deprecated remove this, when all pods use this gem for generation
def self.clean_alias(alias_string)
alias_string.gsub(/\A"|"\Z/, "")
end
private_class_method :parse_link
end
end
end

View file

@ -70,7 +70,7 @@ XML
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Subject>#{acct}</Subject>
<Alias>#{person.alias_url}</Alias>
<Alias>"#{person.alias_url}"</Alias>
<Link rel="http://microformats.org/profile/hcard" type="text/html" href="#{person.hcard_url}"/>
<Link rel="http://joindiaspora.com/seed_location" type = "text/html" href="#{person.url}"/>
<Link rel="http://joindiaspora.com/guid" type = "text/html" href="#{person.guid}"/>