Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Signing verification utilities
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Seal
Building blocks
Signing verification utilities
Commits
899faef2
Commit
899faef2
authored
4 years ago
by
Igor Markin
Browse files
Options
Downloads
Patches
Plain Diff
Add build
parent
c62bd4ff
No related branches found
No related tags found
1 merge request
!77
Resolve "Investigate issue with the caching of files in backblaze"
Pipeline
#42760
passed
4 years ago
Stage: install
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dist/services/CloudflareService.js
+1
-4
1 addition, 4 deletions
dist/services/CloudflareService.js
with
1 addition
and
4 deletions
dist/services/CloudflareService.js
+
1
−
4
View file @
899faef2
...
@@ -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
"
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment