Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3347280
D13410.id44382.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
959 B
Referenced Files
None
Subscribers
None
D13410.id44382.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D13410: [lib] Let blob holder generator take deviceID as argument
Attached
Detach File
Event Timeline
Log In to Comment