diff options
author | Chocobozzz <me@florianbigard.com> | 2020-01-07 15:24:27 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-01-07 15:56:09 +0100 |
commit | e92269053e3fd0e9b9c155ded86a1668444f3d70 (patch) | |
tree | fc6c48416a028fa4f471fbe91f5b982122e303bf /server/helpers/custom-jsonld-signature.ts | |
parent | 7cde3b9c2e84ea20bb0aae4544598483cde9e22c (diff) | |
download | PeerTube-e92269053e3fd0e9b9c155ded86a1668444f3d70.tar.gz PeerTube-e92269053e3fd0e9b9c155ded86a1668444f3d70.tar.zst PeerTube-e92269053e3fd0e9b9c155ded86a1668444f3d70.zip |
Update http signature
Diffstat (limited to 'server/helpers/custom-jsonld-signature.ts')
-rw-r--r-- | server/helpers/custom-jsonld-signature.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/server/helpers/custom-jsonld-signature.ts b/server/helpers/custom-jsonld-signature.ts index cb07fa3b2..a407a9fec 100644 --- a/server/helpers/custom-jsonld-signature.ts +++ b/server/helpers/custom-jsonld-signature.ts | |||
@@ -70,12 +70,20 @@ const lru = new AsyncLRU({ | |||
70 | }) | 70 | }) |
71 | } | 71 | } |
72 | 72 | ||
73 | nodeDocumentLoader(url, cb) | 73 | nodeDocumentLoader(url) |
74 | .then(value => cb(null, value)) | ||
75 | .catch(err => cb(err)) | ||
74 | } | 76 | } |
75 | }) | 77 | }) |
76 | 78 | ||
77 | jsonld.documentLoader = (url, cb) => { | 79 | jsonld.documentLoader = (url) => { |
78 | lru.get(url, cb) | 80 | return new Promise((res, rej) => { |
81 | lru.get(url, (err, value) => { | ||
82 | if (err) return rej(err) | ||
83 | |||
84 | return res(value) | ||
85 | }) | ||
86 | }) | ||
79 | } | 87 | } |
80 | 88 | ||
81 | export { jsonld } | 89 | export { jsonld } |