Problem is the valid request "GET /log.txt" returns "Page Not Found".
Code: Select all
// pageNotFound 404
if (!( StrContains(HTTP_req, "GET / ")) || ( StrContains(HTTP_req, "GET /log.txt "))){
// send a standard http response header
client.println("HTTP/1.1 404");
client.println("Content-Type: text/html");
client.println("Connnection: close");
client.println();
// output webpage
client.println("<!DOCTYPE HTML>");
client.println("<html>\r\n");
client.println("<h2>Page Not Found</h2><br />");
client.println("<html>\r\n");
// reset buffer index and all buffer elements to 0
req_index = 0;
StrClear(HTTP_req, REQ_BUF_SZ);
break;
}
What is happening with the code and is there a solution?