kopia lustrzana https://gitlab.com/jaywink/federation
Correctly identify some platforms that emulate the Mastodon API
Ensure Pixelfed, Kroeg and Kibou instances that emulate the Mastodon API don't get identified as Mastodon instances.merge-requests/159/merge
rodzic
9700af7bee
commit
8c4e4a2197
|
@ -11,7 +11,9 @@
|
|||
fetching by domain and path.
|
||||
|
||||
* Don't crash when parsing an invalid NodeInfo document where the usage dictionary
|
||||
is not following specification.
|
||||
is not following specification.
|
||||
|
||||
* Ensure Pixelfed, Kroeg and Kibou instances that emulate the Mastodon API don't get identified as Mastodon instances.
|
||||
|
||||
## [0.19.0] - 2019-12-15
|
||||
|
||||
|
|
|
@ -55,7 +55,8 @@ def int_or_none(value):
|
|||
|
||||
def parse_mastodon_document(doc, host):
|
||||
# Check first this is not actually Pleroma or Misskey
|
||||
if doc.get('version', '').find('Pleroma') > -1:
|
||||
if doc.get('version', '').find('Pleroma') > -1 or doc.get('version', '').find('Pixelfed') > -1 or \
|
||||
doc.get('version', '').find('Kibou') > -1 or doc.get('version', '').find('Kroeg') > -1:
|
||||
# Use NodeInfo instead, otherwise this is logged as Mastodon
|
||||
from federation.hostmeta.fetchers import fetch_nodeinfo_document
|
||||
return fetch_nodeinfo_document(host)
|
||||
|
|
Ładowanie…
Reference in New Issue