mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-01-23 02:35:23 +00:00
fix: error fetching attachments from blob
This commit is contained in:
parent
41dcdbc41d
commit
d03ec380d1
2 changed files with 5 additions and 4 deletions
|
|
@ -5261,22 +5261,23 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
cipherMessage['attachment'] = attachments.map(attachment => attachment[0]);
|
||||
cipherMessage['attachment_name'] = attachments.map(attachment => attachment[1]);
|
||||
|
||||
cipherMessage['attachment'] = await Promise.all(cipherMessage['attachment'].map(async (attachment) => {
|
||||
cipherMessage['attachment'] = await Promise.all(cipherMessage['attachment'].map(async (attachment, i) => {
|
||||
// we need to retrieve data from blob if browser already parsed it in memory
|
||||
if (typeof attachment === 'string' && attachment.startsWith('blob:')) {
|
||||
Alert.showStatus(
|
||||
[
|
||||
'Retrieving cloned file \'%s\' from memory...',
|
||||
attachment[1]
|
||||
cipherMessage['attachment_name'][i]
|
||||
],
|
||||
'copy'
|
||||
);
|
||||
try {
|
||||
const blobData = await $.ajax({
|
||||
type: 'GET',
|
||||
url: `${attachment}`,
|
||||
url: attachment,
|
||||
processData: false,
|
||||
timeout: 10000,
|
||||
dataType: 'binary',
|
||||
xhrFields: {
|
||||
withCredentials: false,
|
||||
responseType: 'blob'
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class Configuration
|
|||
'js/kjua-0.10.0.js' => 'sha512-BYj4xggowR7QD150VLSTRlzH62YPfhpIM+b/1EUEr7RQpdWAGKulxWnOvjFx1FUlba4m6ihpNYuQab51H6XlYg==',
|
||||
'js/legacy.js' => 'sha512-iP69buypAHBJOgt7AyDcfaelVxBES9/k3dVfd6hPxTRizVRH2dijEpMWCt1D8OH4FNgytKsDI/J7+9y7IgXPaA==',
|
||||
'js/prettify.js' => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==',
|
||||
'js/privatebin.js' => 'sha512-Xg1r4h51hISrW6TR8RplTx22F86DOG5AD+3HC8A+oHeS9tD3/DY2Jqqgq2dPAj+5L0ifBgFdDHClLb6ZsTJdVw==',
|
||||
'js/privatebin.js' => 'sha512-crdFkMyBDo4QyPNeJil/fRSKeBNHDZLZzj5GQm+nQb4PyAvlo2+A8RzGbQAF0YjkeNP+ZHn4Jo9xAnh9YVvN2Q==',
|
||||
'js/purify-3.3.0.js' => 'sha512-lsHD5zxs4lu/NDzaaibe27Vd2t7Cy9JQ3qDHUvDfb4oZvKoWDNEhwUY+4bT3R68cGgpgCYp8U1x2ifeVxqurdQ==',
|
||||
'js/rawinflate-0.3.js' => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==',
|
||||
'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue