Page MenuHomePhabricator

D13410.id44382.diff
No OneTemporary

D13410.id44382.diff

diff --git a/lib/utils/blob-service.js b/lib/utils/blob-service.js
--- a/lib/utils/blob-service.js
+++ b/lib/utils/blob-service.js
@@ -57,13 +57,18 @@
* Generates random blob holder prefixed by current device ID
*/
async function generateBlobHolder(): Promise<string> {
- const randomID = uuid.v4();
+ const generateHolder = await createBlobHolderGenerator();
+ return generateHolder();
+}
+
+async function createBlobHolderGenerator(): Promise<() => string> {
try {
const deviceID = await getContentSigningKey();
const urlSafeDeviceID = toBase64URL(deviceID);
- return `${urlSafeDeviceID}:${randomID}`;
+ return () => `${urlSafeDeviceID}:${uuid.v4()}`;
} catch {
- return randomID;
+ // for Flow
+ return () => `${uuid.v4()}`;
}
}
@@ -73,6 +78,7 @@
blobHashFromURI,
blobHashFromBlobServiceURI,
generateBlobHolder,
+ createBlobHolderGenerator,
getBlobFetchableURL,
makeBlobServiceEndpointURL,
};

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 11:38 AM (18 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2570450
Default Alt Text
D13410.id44382.diff (959 B)

Event Timeline