The solution to the problem is to add the header res.addHeader("Access-Control-Allow-Origin", "*");
to the HTTP server;
hServer.route("/", QHttpServerRequest::Method::Get, []()
{
QString testAnswer = "TEST REPLY";
res.addHeader("Access-Control-Allow-Origin", "*"); // Added line
QHttpServerResponse res(testAnswer, QHttpServerResponse::StatusCode::Ok);
return res;
});
After adding this line, the browser forwarded the reply to my application.