Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libre
Samizdat
Commits
516a6965
Commit
516a6965
authored
Sep 30, 2020
by
Michał Woźniak
Browse files
gateway-ipns: CORS means we don't usually get an ETag *sigh*
parent
114b51ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/gateway-ipns.js
View file @
516a6965
...
...
@@ -102,7 +102,14 @@
// add the X-Samizdat-* headers to the mix
init
.
headers
[
'
X-Samizdat-Method
'
]
=
'
gateway-ipns
'
// we will not have it most of the time, due to CORS rules:
// https://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_response_header
init
.
headers
[
'
X-Samizdat-ETag
'
]
=
response
.
headers
.
get
(
'
ETag
'
)
if
(
init
.
headers
[
'
X-Samizdat-ETag
'
]
===
null
)
{
// far from perfect, but what are we going to do, eh?
init
.
headers
[
'
X-Samizdat-ETag
'
]
=
response
.
headers
.
get
(
'
last-modified
'
)
}
// return the new response, using the Blob from the original one
return
response
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment