mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
feat: allow activitypub request cache to be ignored
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user