Sfoglia il codice sorgente

Be more strict when serving note objects.

default 3 anni fa
parent
commit
46cfc37f2b
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      activitypub.c

+ 4 - 0
activitypub.c

@@ -2059,6 +2059,10 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path,
         xs *id = xs_fmt("%s/%s", snac.actor, p_path);
         xs *id = xs_fmt("%s/%s", snac.actor, p_path);
 
 
         status = object_get(id, &msg);
         status = object_get(id, &msg);
+
+        /* don't return non-public objects */
+        if (valid_status(status) && !is_msg_public(msg))
+            status = 404;
     }
     }
     else
     else
         status = 404;
         status = 404;