diff --git a/test/test_webfinger.py b/test/test_webfinger.py index 5069575..ded6f89 100644 --- a/test/test_webfinger.py +++ b/test/test_webfinger.py @@ -83,18 +83,18 @@ class WebFingerTest(unittest.TestCase): self.assertEquals({ 'subject': 'acct:@foo.com', 'aliases': [ - 'https://foo.com/', 'https://foo.com/about-me', + 'https://foo.com/', ], 'magic_keys': [{'value': key.href()}], 'links': [{ 'rel': 'http://webfinger.net/rel/profile-page', 'type': 'text/html', - 'href': 'https://foo.com/' + 'href': 'https://foo.com/about-me' }, { 'rel': 'http://webfinger.net/rel/profile-page', 'type': 'text/html', - 'href': 'https://foo.com/about-me' + 'href': 'https://foo.com/' }, { 'rel': 'magic-public-key', 'href': key.href(), diff --git a/webfinger.py b/webfinger.py index a01b92b..41517be 100644 --- a/webfinger.py +++ b/webfinger.py @@ -43,7 +43,7 @@ representative h-card on %s""" % resp.url) uri = '@%s' % domain key = models.MagicKey.get_or_create(uri) props = hcard.get('properties', {}) - urls = sorted(set(props.get('url', []) + [resp.url])) + urls = util.dedupe_urls(props.get('url', []) + [resp.url]) # appengine_config.HOST return util.trim_nulls({