502 Bad Gateway error after the service worker deprecation

After the service worker deprecation, our storage canisters (written in Motoko) are displaying the “502 Bad Gateway” error as you can see in this url: .

Here you can see the http_request function implementation in our storage canisters: https://github.com/Aikindapps/Nuance/blob/master/src/Storage/storage/buckets.mo#L243
Any idea what could be the reason?

I’m able to solve it by removing all the header fields except the “Content-Type”.