Allow Cross-Origin Resource Sharing (CORS) (#1008)

This commit is contained in:
cosmic-snow 2023-06-22 18:19:49 +02:00 committed by GitHub
parent af28173a25
commit a423075403
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,6 +143,11 @@ void Server::start()
}
);
m_server->afterRequest([] (QHttpServerResponse &&resp) {
resp.addHeader("Access-Control-Allow-Origin", "*");
return std::move(resp);
});
connect(this, &Server::requestServerNewPromptResponsePair, m_chat,
&Chat::serverNewPromptResponsePair, Qt::BlockingQueuedConnection);
}