enable CORS for web server
This commit is contained in:
parent
1107590b56
commit
b6f8bd93ef
@ -166,6 +166,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,6 +247,7 @@ void CrossPointWebServer::handleFileListData() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server->sendHeader("Access-Control-Allow-Origin", "*");
|
||||||
server->setContentLength(CONTENT_LENGTH_UNKNOWN);
|
server->setContentLength(CONTENT_LENGTH_UNKNOWN);
|
||||||
server->send(200, "application/json", "");
|
server->send(200, "application/json", "");
|
||||||
server->sendContent("[");
|
server->sendContent("[");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user