Commit 516a6965 authored by Michał Woźniak's avatar Michał Woźniak
Browse files

gateway-ipns: CORS means we don't usually get an ETag *sigh*

parent 114b51ef
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment