diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-19 18:28:34 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-19 18:29:02 +0300 |
commit | 73dfdac9506f1e425aa7452971cf7b8de3484ff7 (patch) | |
tree | 2884b9f9c5bd2dfb362da3622beaeea467c56c78 | |
parent | 6c9ee57d83d30d598062cfa95a73555808e04e7f (diff) | |
download | which-ui-73dfdac9506f1e425aa7452971cf7b8de3484ff7.tar.gz |
fix: add querystring to avoid caching request
-rw-r--r-- | src/hooks/useS3Preupload.tsx | 4 |
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 => { |