consolidate test-ip definition, added missing Access-Control-Allow-Origin,

This commit is contained in:
CaCO3
2023-01-02 00:53:14 +01:00
parent e6cb9d67ee
commit 56cfeb732e
28 changed files with 266 additions and 263 deletions

View File

@@ -147,6 +147,7 @@ esp_err_t handler_init(httpd_req_t *req)
doInit();
resp_str = "Init done<br>";
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_send(req, resp_str, strlen(resp_str));
/* Respond with an empty chunk to signal HTTP response completion */
httpd_resp_send_chunk(req, NULL, 0);
@@ -179,6 +180,8 @@ esp_err_t handler_flow_start(httpd_req_t *req) {
httpd_resp_send(req, resp_str, strlen(resp_str));
}
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
/* Respond with an empty chunk to signal HTTP response completion */
httpd_resp_send_chunk(req, NULL, 0);
@@ -421,6 +424,8 @@ esp_err_t handler_editflow(httpd_req_t *req)
char _valuechar[30];
string _task;
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
if (httpd_req_get_url_query_str(req, _query, 200) == ESP_OK)
{
if (httpd_query_key_value(_query, "task", _valuechar, 30) == ESP_OK)