Remove references to http://schema.org from inbound AP contexts.

ap-processing-improvements
Alain St-Denis 2023-07-26 12:57:47 -04:00
rodzic 6fd445382d
commit 7559f16f4f
1 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -113,12 +113,13 @@ class LdContextManager:
if 'python-federation"' in s:
ctx = json.loads(s.replace('python-federation', 'python-federation#', 1))
# some platforms have http://joinmastodon.com/ns in @context. This
# is not a json-ld document.
try:
ctx.pop(ctx.index('http://joinmastodon.org/ns'))
except ValueError:
pass
# Some platforms have reference invalid json-ld document in @context.
# Remove those.
for url in ['http://joinmastodon.org/ns', 'http://schema.org']:
try:
ctx.pop(ctx.index(url))
except ValueError:
pass
# remove @language in context since this directive is not
# processed by calamus. Pleroma adds a useless @language: 'und'