team113 / messenger

Open-source front-end part of messenger by team113
GNU Affero General Public License v3.0
16 stars 14 forks source link

Fix embedded resources missing `Cross-Origin-Embedder-Policy` header #1011

Closed SleepySquash closed 4 months ago

SleepySquash commented 4 months ago

Related to #996 Related to #998 Related to #1002

Synopsis

We've added Cross-Origin-Embedder-Policy header in #1002 to support drift OPFS and WebAssembly building (those use the SharedArrayBuffers available only on cross origin isolated sites). However, it turned out that not only the resource embedding other resources must have COEP header, but the embedded resources must have one as well:

Снимок экрана 2024-05-20 в 09 28 22 Снимок экрана 2024-05-20 в 09 33 42

Solution

This PR adds COEP header to each nginx hosted resource (e.g. drift_worker.dart.js).

Checklist

SleepySquash commented 4 months ago

FCM

Add `Cross-Origin-Embedder-Policy` header to embedded resources in `nginx.conf` (#1011)
SleepySquash commented 4 months ago

Discussed: location / already sets the header. It was missing due to Chrome caching the response.