MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / SendHttpNotFound

Method SendHttpNotFound

cpp/webdriver-server/server.cc:600–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

598}
599
600void Server::SendHttpNotFound(struct mg_connection* const connection,
601 const struct mg_request_info* request_info,
602 const std::string& body) {
603 LOG(TRACE) << "Entering Server::SendHttpNotFound";
604
605 std::string body_to_send = body + "\r\n";
606
607 std::ostringstream out;
608 out << "HTTP/1.1 404 Not Found\r\n"
609 << "Content-Length: " << strlen(body_to_send.c_str()) << "\r\n"
610 << "Content-Type: application/json; charset=utf-8\r\n"
611 << "Cache-Control: no-cache\r\n"
612 << "Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept\r\n"
613 << "Accept-Ranges: bytes\r\n\r\n";
614 if (strcmp(request_info->request_method, "HEAD") != 0) {
615 out << body_to_send;
616 }
617
618 mg_printf(connection, "%s", out.str().c_str());
619}
620
621void Server::SendHttpMethodNotAllowed(
622 struct mg_connection* connection,

Callers 1

SendResponseToClientMethod · 0.95

Calls 1

LOGClass · 0.70

Tested by

no test coverage detected