Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid multiple Access-Control-Allow-Origin * #1859

Merged
merged 2 commits into from
Jan 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions code/components/jomjol_tfliteclass/server_tflite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ void CheckIsPlannedReboot()
DeleteFile("/sdcard/reboot.txt"); // Prevent Boot Loop!!!
isPlannedReboot = true;
}


}


Expand Down Expand Up @@ -462,8 +460,6 @@ 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)
Expand All @@ -477,13 +473,13 @@ esp_err_t handler_editflow(httpd_req_t *req)

if (_task.compare("namenumbers") == 0)
{
ESP_LOGI(TAG, "Get NUMBER list");
ESP_LOGD(TAG, "Get NUMBER list");
return get_numbers_file_handler(req);
}

if (_task.compare("data") == 0)
{
ESP_LOGI(TAG, "Get data list");
ESP_LOGD(TAG, "Get data list");
return get_data_file_handler(req);
}

Expand Down Expand Up @@ -513,6 +509,7 @@ esp_err_t handler_editflow(httpd_req_t *req)

CopyFile(in, out);
zw = "Copy Done";
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_send(req, zw.c_str(), zw.length());
}

Expand Down Expand Up @@ -582,6 +579,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
delete cim;

zw = "CutImage Done";
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_send(req, zw.c_str(), zw.length());

}
Expand Down Expand Up @@ -625,6 +623,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
Camera.SetLEDIntensity(intens);
ESP_LOGD(TAG, "test_take - vor MakeImage");
std::string zw = tfliteflow.doSingleStep("[MakeImage]", _host);
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_send(req, zw.c_str(), zw.length());
}

Expand All @@ -639,6 +638,7 @@ esp_err_t handler_editflow(httpd_req_t *req)

// string zwzw = "Do " + _task + " start\n"; ESP_LOGD(TAG, zwzw.c_str());
std::string zw = tfliteflow.doSingleStep("[Alignment]", _host);
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_send(req, zw.c_str(), zw.length());
}

Expand Down