From 68d59b399e7c0e918d0ff9dcfdb17076049513f8 Mon Sep 17 00:00:00 2001 From: Tyler Kennedy Date: Sun, 27 Nov 2022 16:43:46 -0500 Subject: Set content type when serving object Fixes #37 --- activities/views/posts.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'activities/views') diff --git a/activities/views/posts.py b/activities/views/posts.py index b9bdc7f..e394c4e 100644 --- a/activities/views/posts.py +++ b/activities/views/posts.py @@ -75,7 +75,10 @@ class Individual(TemplateView): # If this not a local post, redirect to its canonical URI if not self.post_obj.local: return redirect(self.post_obj.object_uri) - return JsonResponse(canonicalise(self.post_obj.to_ap(), include_security=True)) + return JsonResponse( + canonicalise(self.post_obj.to_ap(), include_security=True), + content_type="application/activity+json", + ) @method_decorator(identity_required, name="dispatch") -- cgit v1.2.3