mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 10:49:15 +02:00
Ensures federation urls can answer to application/ld+json, application/activity+json and application/json requests
This commit is contained in:
parent
c9e7eea65b
commit
12c9db3960
19 changed files with 1294 additions and 1001 deletions
|
@ -1,8 +1,17 @@
|
|||
from rest_framework.renderers import JSONRenderer
|
||||
|
||||
|
||||
class ActivityPubRenderer(JSONRenderer):
|
||||
media_type = "application/activity+json"
|
||||
def get_ap_renderers():
|
||||
MEDIA_TYPES = [
|
||||
("APActivity", "application/activity+json"),
|
||||
("APLD", "application/ld+json"),
|
||||
("APJSON", "application/json"),
|
||||
]
|
||||
|
||||
return [
|
||||
type(name, (JSONRenderer,), {"media_type": media_type})
|
||||
for name, media_type in MEDIA_TYPES
|
||||
]
|
||||
|
||||
|
||||
class WebfingerRenderer(JSONRenderer):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue