Skip to content
Snippets Groups Projects
Commit 899faef2 authored by Igor Markin's avatar Igor Markin
Browse files

Add build

parent c62bd4ff
No related branches found
No related tags found
1 merge request!77Resolve "Investigate issue with the caching of files in backblaze"
Pipeline #42760 passed
...@@ -32,10 +32,7 @@ class CloudflareService { ...@@ -32,10 +32,7 @@ class CloudflareService {
} }
fetchFile(fileName, bucket = this._defaultBucket) { fetchFile(fileName, bucket = this._defaultBucket) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
// v?= is a dirty fix to prevent caching of the CORS error response in case file is missing. const response = yield axios_1.default(`${this._cdnUrl}/file/${bucket}/${fileName}`);
// Because of browser caching CORS error in case of missing file, it's not possible to retrieve it when it's being uploaded.
// Dig into https://www.backblaze.com/b2/docs/cors_rules.html and fix
const response = yield axios_1.default(`${this._cdnUrl}/file/${bucket}/${fileName}?v=${Math.random()}`);
const data = response.data; const data = response.data;
const uploadTime = response.headers["x-bz-upload-timestamp"] const uploadTime = response.headers["x-bz-upload-timestamp"]
? parseInt(response.headers["x-bz-upload-timestamp"]) ? parseInt(response.headers["x-bz-upload-timestamp"])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment