From 435562cc704bcbf22d2046f259ebd11c5a078ef7 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Wed, 22 Dec 2021 19:16:51 -0300 Subject: [PATCH] FIX: Uploads were broken in old Safari (#15391) Blob.prototype.arrayBuffer is Safari 14 onwards, so we can check to see if this exists and just skip the checksumming if not. --- .../javascripts/discourse/app/lib/uppy-checksum-plugin.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/discourse/app/lib/uppy-checksum-plugin.js b/app/assets/javascripts/discourse/app/lib/uppy-checksum-plugin.js index 0b54cf851d7..27db3d1b933 100644 --- a/app/assets/javascripts/discourse/app/lib/uppy-checksum-plugin.js +++ b/app/assets/javascripts/discourse/app/lib/uppy-checksum-plugin.js @@ -24,6 +24,12 @@ export default class UppyChecksum extends UploadPreProcessorPlugin { ); return false; } + if (!Blob.prototype.arrayBuffer) { + this._consoleWarn( + "The required File API is unavailable in this browser." + ); + return false; + } if (!this._hasCryptoCipher()) { this._consoleWarn( "The required cipher suite is unavailable in this browser."