enable cors for api
This commit is contained in:
parent
e7f3ac8319
commit
9461cd5d48
@ -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];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user