fix (backend): reject anonymous objects

This commit is contained in:
Laura Hausmann 2024-03-27 23:01:51 +09:00 committed by naskya
parent 2e51a33ae5
commit e753b313da
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -133,7 +133,10 @@ export default class Resolver {
throw new Error("invalid response"); throw new Error("invalid response");
} }
if (object.id == null) return object; if (object.id == null) {
throw new Error("Object has no ID");
}
if (finalUrl === object.id) return object; if (finalUrl === object.id) return object;
if (new URL(finalUrl).host !== new URL(object.id).host) { if (new URL(finalUrl).host !== new URL(object.id).host) {