Page MenuHomePhabricator

D7976.diff
No OneTemporary

D7976.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
Wed, Dec 4, 11:31 AM (10 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2614120
Default Alt Text
D7976.diff (1 KB)

Event Timeline