From 73dfdac9506f1e425aa7452971cf7b8de3484ff7 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Wed, 19 Aug 2020 18:28:34 +0300
Subject: fix: add querystring to avoid caching request

---
 src/hooks/useS3Preupload.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/hooks/useS3Preupload.tsx')

diff --git a/src/hooks/useS3Preupload.tsx b/src/hooks/useS3Preupload.tsx
index 3545cd5..1fb2cd6 100644
--- a/src/hooks/useS3Preupload.tsx
+++ b/src/hooks/useS3Preupload.tsx
@@ -45,7 +45,9 @@ export default (): Hook => {
       };
 
       setProgress(0.01);
-      return get('/files')
+      // Add querystring to avoid caching request in some browsers, see
+      // https://stackoverflow.com/questions/59339561/safari-skipping-xmlhttprequests
+      return get(`/files?key=${file.name}`)
         .then(response => response.data)
         .then(uploadUrl => axios.put(uploadUrl, file, config))
         .then(response => {
-- 
cgit v1.2.3

