mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-21 19:53:50 +01:00
[backend] Enforce JSON-LD profile when fetching activities
This commit is contained in:
parent
31122636d3
commit
099ba9ce65
@ -48,7 +48,9 @@ export async function getJsonActivity(
|
||||
});
|
||||
|
||||
const contentType = res.headers.get('content-type');
|
||||
if (contentType == null || (contentType !== 'application/activity+json' && !contentType.startsWith('application/activity+json;') && contentType !== 'application/ld+json' && !contentType.startsWith('application/ld+json;')))
|
||||
if (contentType == null ||
|
||||
(contentType !== 'application/activity+json' && !contentType.startsWith('application/activity+json;') &&
|
||||
(!contentType.startsWith('application/ld+json;') || !contentType.includes('profile="https://www.w3.org/ns/activitystreams"'))))
|
||||
throw new Error(`getJsonActivity response had unexpected content-type: ${contentType}`);
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user