Page MenuHomePhabricator

D7976.id27249.diff
No OneTemporary

D7976.id27249.diff

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

Mime Type
text/plain
Expires
Thu, Dec 5, 1:31 AM (13 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2614120
Default Alt Text
D7976.id27249.diff (1 KB)

Event Timeline