enable cors for api

This commit is contained in:
gebeto 2025-12-23 23:59:31 +02:00
parent e7f3ac8319
commit 9461cd5d48

View File

@ -167,6 +167,7 @@ void CrossPointWebServer::handleStatus() const {
json += "\"uptime\":" + String(millis() / 1000); json += "\"uptime\":" + String(millis() / 1000);
json += "}"; json += "}";
server->sendHeader("Access-Control-Allow-Origin", "*");
server->send(200, "application/json", json); server->send(200, "application/json", json);
} }
@ -248,6 +249,7 @@ void CrossPointWebServer::handleFileListData() const {
} }
server->setContentLength(CONTENT_LENGTH_UNKNOWN); server->setContentLength(CONTENT_LENGTH_UNKNOWN);
server->sendHeader("Access-Control-Allow-Origin", "*");
server->send(200, "application/json", ""); server->send(200, "application/json", "");
server->sendContent("["); server->sendContent("[");
char output[512]; char output[512];