Service worker fetching result in 400 on cloudflare ipfs gateway. works on other gateways

Hi,
I am having issue with service worker when served from cloudflare ipfs gateway. It return a 400

request:

:authority: cloudflare-ipfs.com
:method: GET
:path: /ipfs/QmRm77vo2VgQULULHUQXssAAux3cSAqSnEaZSU6FS1paHP/sw.js
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cache-control: max-age=0
cookie: __cfduid=dbe69e3393e171e83e8a2978322a935231599656925
referer: https://cloudflare-ipfs.com/ipfs/QmRm77vo2VgQULULHUQXssAAux3cSAqSnEaZSU6FS1paHP/
sec-fetch-dest: serviceworker
sec-fetch-mode: same-origin
sec-fetch-site: same-origin
service-worker: script
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4252.0 Safari/537.36

response:

cf-ray: 5d0123cacfc51e0a-MAN
cf-request-id: 051494b2b800001e0a8b19e200000001
content-length: 68
content-type: text/plain;charset=UTF-8
date: Wed, 09 Sep 2020 13:08:45 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
status: 400
vary: Accept-Encoding

It works fine on other ipfs gateways. Does cloudflare block service worker on ipfs ?
If so why ?
Any way around to have PWA working on ipfs urls ?

with curl

this works

 curl https://cloudflare-ipfs.com/ipfs/QmRm77vo2VgQULULHUQXssAAux3cSAqSnEaZSU6FS1paHP/sw.js

this fails:

 curl -H "service-worker: script" https://cloudflare-ipfs.com/ipfs/QmRm77vo2VgQULULHUQXssAAux3cSAqSnEaZSU6FS1paHP/sw.js

Hello @wighawag that is quite interesting, do you mind opening a ticket so we can investigate that more?
Please paste the ticket number here when you ready.

Please share with us a HAR file demonstrating the issue?

Make sure to set up your Browser’s Developer tools to “Preserve Logs”.
more detailed information for sending debugging info:

I would suggest sending 2 har files, one with DNS over Cloudflare and one without.

Thanks for the quick reply.
I created a ticket : 1975170
Re 2 HAR files, There is no DNS over cloudflare option since the issue is on cloudflare IPFS gateway itself
So I send the HAR file from browsing : https://cloudflare-ipfs.com/ipfs/QmRm77vo2VgQULULHUQXssAAux3cSAqSnEaZSU6FS1paHP/

1 Like

Hi @stefano1
Any updates on the issue? The ticket got closed, arguing that as a free user, they do not have time to look at it.
But the issue has nothing to do with me or my application, it affects every user of cloudflare ipfs gateway.

It would be great to have an update on this and whether you intends to fix it.

Thanks