[web] Set COEP:credentialless on flutter run/drive. (#152413)

This PR changes the value of the `COEP` response header from `require-corp` to `credentialless` in the Flutter tool, when running `flutter run`/`drive` for Web projects.

This enables running tests compiled to wasm, that access 3P resources (like Google Maps) without blocking those resources.

Docs:

* https://developer.chrome.com/blog/coep-credentialless-origin-trial#credentialless_to_the_rescue

## Issue

* https://github.com/flutter/flutter/issues/152411
This commit is contained in:
David Iglesias
2024-07-30 16:14:06 -07:00
committed by GitHub
parent 4778895036
commit 111b4fe6d1
3 changed files with 5 additions and 5 deletions

View File

@@ -160,7 +160,7 @@ void main() {
expect(response.statusCode, HttpStatus.ok);
final Map<String, String> headers = response.headers;
expect(headers['Cross-Origin-Opener-Policy'], 'same-origin');
expect(headers['Cross-Origin-Embedder-Policy'], 'require-corp');
expect(headers['Cross-Origin-Embedder-Policy'], 'credentialless');
});
testWithoutContext('release asset server serves html content without COOP/COEP headers when specified', () async {