Allow to send web command from another server if enabled

mainly for camera html hosted on another server
This commit is contained in:
Luc 2019-10-01 08:48:27 +08:00
parent 7e9f785d47
commit d40c62cb53

View File

@ -199,6 +199,9 @@ size_t ESP3DOutput::printMSG(const char * s)
if (_webserver) { if (_webserver) {
if (!_headerSent && !_footerSent) { if (!_headerSent && !_footerSent) {
_webserver->sendHeader("Cache-Control","no-cache"); _webserver->sendHeader("Cache-Control","no-cache");
#ifdef ESP_ACCESS_CONTROL_ALLOW_ORIGIN
_webserver->sendHeader("Access-Control-Allow-Origin", "*");
#endif //ESP_ACCESS_CONTROL_ALLOw_ORIGIN
_webserver->send (_code, "text/plain", s); _webserver->send (_code, "text/plain", s);
_headerSent = true; _headerSent = true;
_footerSent = true; _footerSent = true;