mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-12 16:36:38 +02:00
* fix #270
This commit is contained in:
parent
445423209d
commit
b9bc7e6b57
3 changed files with 7 additions and 7 deletions
|
@ -36,7 +36,7 @@ void webApi::loop(void) {
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
void webApi::onApi(AsyncWebServerRequest *request) {
|
||||
AsyncJsonResponse* response = new AsyncJsonResponse(false, 2048);
|
||||
AsyncJsonResponse* response = new AsyncJsonResponse(false, 4096);
|
||||
JsonObject root = response->getRoot();
|
||||
|
||||
Inverter<> *iv = mApp->mSys->getInverterByPos(0, false);
|
||||
|
@ -54,9 +54,9 @@ void webApi::onApi(AsyncWebServerRequest *request) {
|
|||
else
|
||||
getNotFound(root, F("http://") + request->host() + F("/api/"));
|
||||
|
||||
response->setLength();
|
||||
response->addHeader("Access-Control-Allow-Origin", "*");
|
||||
response->addHeader("Access-Control-Allow-Headers", "content-type");
|
||||
response->setLength();
|
||||
request->send(response);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue