From 5c965a57e1d0534c1ef69be5e7b76781462f719c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 31 Jul 2021 18:14:25 +0100 Subject: [PATCH] Alternative actor formats --- daemon.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index 37582e1e3..883b99fe8 100644 --- a/daemon.py +++ b/daemon.py @@ -9905,11 +9905,19 @@ class PubServer(BaseHTTPRequestHandler): 'show profile posts') else: if self._fetchAuthenticated(): + acceptStr = self.headers['Accept'] msgStr = json.dumps(actorJson, ensure_ascii=False) msg = msgStr.encode('utf-8') msglen = len(msg) - self._set_headers('application/ld+json', msglen, - cookie, callingDomain) + if 'application/ld+json' in acceptStr: + self._set_headers('application/ld+json', msglen, + cookie, callingDomain) + elif 'application/jrd+json' in acceptStr: + self._set_headers('application/jrd+json', msglen, + cookie, callingDomain) + else: + self._set_headers('application/activity+json', msglen, + cookie, callingDomain) self._write(msg) else: self._404()