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

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

parent 114b51ef
Pipeline #46845 passed with stage
in 12 minutes and 49 seconds
......@@ -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:
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