Allow to embed the presentation in window

Similar like in:
commit d9d13d7092
wasm: support serving wasm files

add headers required when we use WASM so we are able to
embed presentation in window.

Without that we get:
not-set Cross-Origin-Embedder-Policy

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I03ca3717488a92fe405693764f3f18a964b23bf7
pull/8802/head
Szymon Kłos 2024-04-23 09:10:55 +02:00 committed by Szymon Kłos
parent 1ff9451754
commit 01a30b03f1
1 changed files with 9 additions and 0 deletions

View File

@ -1489,6 +1489,15 @@ void ClientRequestDispatcher::handlePostRequest(const RequestDetails& requestDet
if (serveAsAttachment && contentType != "image/svg+xml")
response.set("Content-Disposition", "attachment; filename=\"" + fileName + '"');
#if !MOBILEAPP
if (COOLWSD::WASMState != COOLWSD::WASMActivationState::Disabled)
{
response.add("Cross-Origin-Opener-Policy", "same-origin");
response.add("Cross-Origin-Embedder-Policy", "require-corp");
response.add("Cross-Origin-Resource-Policy", "cross-origin");
}
#endif // !MOBILEAPP
try
{
HttpHelper::sendFileAndShutdown(socket, filePath.toString(), response);