[backend] Reject anonymous objects in the AP resolver

This commit is contained in:
Laura Hausmann 2024-03-27 13:02:04 +01:00
parent ac57c58ecf
commit cf506d3bd9
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -124,7 +124,7 @@ export default class Resolver {
const {res, object} = await this.doFetch(value); const {res, object} = await this.doFetch(value);
if (object.id == null) return object; if (object.id == null) throw new Error("Object has no ID");
if (res.finalUrl === object.id) return object; if (res.finalUrl === object.id) return object;
if (new URL(res.finalUrl).host !== new URL(object.id).host) if (new URL(res.finalUrl).host !== new URL(object.id).host)