Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4936456
D7976.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7976.id.diff
View Options
diff --git a/native/media/encryption-utils.js b/native/media/encryption-utils.js
--- a/native/media/encryption-utils.js
+++ b/native/media/encryption-utils.js
@@ -22,6 +22,7 @@
import type { MediaResult } from './media-utils.js';
import { commUtilsModule } from '../native-modules.js';
import * as AES from '../utils/aes-crypto-module.js';
+import { arrayBufferFromBlob } from '../utils/blob-utils-module.js';
const PADDING_THRESHOLD = 5000000; // we don't pad files larger than this
@@ -63,7 +64,8 @@
data = new Uint8Array(buffer);
} else {
const response = await fetch(getFetchableURI(uri));
- const buffer = await response.arrayBuffer();
+ const blob = await response.blob();
+ const buffer = arrayBufferFromBlob(blob);
data = new Uint8Array(buffer);
}
} catch (e) {
@@ -296,8 +298,9 @@
if (!response.ok) {
throw new Error(`HTTP error ${response.status}: ${response.statusText}`);
}
- const buf = await response.arrayBuffer();
- data = new Uint8Array(buf);
+ const blob = await response.blob();
+ const buffer = arrayBufferFromBlob(blob);
+ data = new Uint8Array(buffer);
} catch (e) {
success = false;
exceptionMessage = getMessageForException(e);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 9:44 PM (10 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3360712
Default Alt Text
D7976.id.diff (1 KB)
Attached To
Mode
D7976: [native] Use BlobUtils for media encryption/decryption
Attached
Detach File
Event Timeline
Log In to Comment