Open TimotF opened 5 years ago
For anyone having the same isue : try to add the following line
server.sendHeader("access-control-allow-origin","*");
The complete handleNotFound function should be :
void handleNotFound() {
String message = "Server is running!\n\n";
message += "URI: ";
message += server.uri();
message += "\nMethod: ";
message += (server.method() == HTTP_GET) ? "GET" : "POST";
message += "\nArguments: ";
message += server.args();
message += "\n";
server.sendHeader("access-control-allow-origin","*");
server.send(200, "text/plain", message);
Serial.println(message);
if (server.hasArg("ql")) {
int ql = server.arg("ql").toInt();
#if defined (OV2640_MINI_2MP) || defined (OV2640_CAM)
myCAM.OV2640_set_JPEG_size(ql);
#elif defined (OV5640_MINI_5MP_PLUS) || defined (OV5640_CAM)
myCAM.OV5640_set_JPEG_size(ql);
#elif defined (OV5642_MINI_5MP_PLUS) || defined (OV5642_MINI_5MP_BIT_ROTATION_FIXED) ||(defined (OV5642_CAM))
myCAM.OV5642_set_JPEG_size(ql);
#endif
Serial.println("QL change to: " + server.arg("ql"));
}
}
No, the problem is the same...
Hi,
I'm having an issue getting the capture example running : when the GET request is sent to the ESP32, I get the response
But at the same time, I get an error on the console saying that a CORS request has been blocked as the CORS header was missing. I tried with 3 different browser (firefox, edge, chrome) but without success (still can't get the image from the camera)...