From 9fe2e6676c32b93023ae301be587a8ab0d93120f Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Mon, 5 Dec 2022 20:02:35 -0700 Subject: Add a middleware to detect LD Accept headers --- activities/views/posts.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'activities/views') diff --git a/activities/views/posts.py b/activities/views/posts.py index 1962274..adc732c 100644 --- a/activities/views/posts.py +++ b/activities/views/posts.py @@ -21,12 +21,7 @@ class Individual(TemplateView): self.identity = by_handle_or_404(self.request, handle, local=False) self.post_obj = get_object_or_404(self.identity.posts, pk=post_id) # If they're coming in looking for JSON, they want the actor - accept = request.headers.get("accept", "text/html").lower() - if ( - "application/json" in accept - or "application/ld" in accept - or "application/activity" in accept - ): + if request.ap_json: # Return post JSON return self.serve_object() else: -- cgit v1.2.3