aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-08-19 18:31:12 +0300
committerGitHub <noreply@github.com>2020-08-19 18:31:12 +0300
commit32aedd44555b25221e40543f062eaf5fde51a347 (patch)
tree2884b9f9c5bd2dfb362da3622beaeea467c56c78 /src
parent6c9ee57d83d30d598062cfa95a73555808e04e7f (diff)
parent73dfdac9506f1e425aa7452971cf7b8de3484ff7 (diff)
downloadwhich-ui-32aedd44555b25221e40543f062eaf5fde51a347.tar.gz
Merge pull request #91 from which-ecosystem/requests-bug
Fix random request caching bug
Diffstat (limited to 'src')
-rw-r--r--src/hooks/useS3Preupload.tsx4
1 files changed, 3 insertions, 1 deletions
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 => {