feat: allow activitypub request cache to be ignored

This commit is contained in:
Julian Lam
2024-07-09 14:45:04 -04:00
parent 5e343a83f8
commit 485b775837
2 changed files with 7 additions and 3 deletions

View File

@@ -251,10 +251,14 @@ ActivityPub.verify = async (req) => {
}
};
ActivityPub.get = async (type, id, uri) => {
ActivityPub.get = async (type, id, uri, options) => {
options = {
cache: true,
...options,
};
const cacheKey = [id, uri].join(';');
const cached = requestCache.get(cacheKey);
if (cached !== undefined) {
if (options.cache && cached !== undefined) {
return cached;
}