mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-28 10:42:08 +00:00
Added access-control-allow headers
This commit is contained in:
parent
038ddb887f
commit
8414f4a6a3
@ -332,6 +332,8 @@ void handleAPIv1FromRadio(HTTPRequest *req, HTTPResponse *res)
|
|||||||
|
|
||||||
// Status code is 200 OK by default.
|
// Status code is 200 OK by default.
|
||||||
res->setHeader("Content-Type", "application/x-protobuf");
|
res->setHeader("Content-Type", "application/x-protobuf");
|
||||||
|
res->setHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
res->setHeader("Access-Control-Allow-Methods", "PUT, GET");
|
||||||
|
|
||||||
uint8_t txBuf[MAX_STREAM_BUF_SIZE];
|
uint8_t txBuf[MAX_STREAM_BUF_SIZE];
|
||||||
|
|
||||||
@ -359,6 +361,8 @@ void handleAPIv1ToRadio(HTTPRequest *req, HTTPResponse *res)
|
|||||||
|
|
||||||
// Status code is 200 OK by default.
|
// Status code is 200 OK by default.
|
||||||
res->setHeader("Content-Type", "application/x-protobuf");
|
res->setHeader("Content-Type", "application/x-protobuf");
|
||||||
|
res->setHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
res->setHeader("Access-Control-Allow-Methods", "PUT, GET");
|
||||||
|
|
||||||
byte buffer[MAX_TO_FROM_RADIO_SIZE];
|
byte buffer[MAX_TO_FROM_RADIO_SIZE];
|
||||||
size_t s = req->readBytes(buffer, MAX_TO_FROM_RADIO_SIZE);
|
size_t s = req->readBytes(buffer, MAX_TO_FROM_RADIO_SIZE);
|
||||||
|
Loading…
Reference in New Issue
Block a user