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

Method SendHttpInternalError

cpp/webdriver-server/server.cc:579–598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577}
578
579void Server::SendHttpInternalError(struct mg_connection* connection,
580 const struct mg_request_info* request_info,
581 const std::string& body) {
582 LOG(TRACE) << "Entering Server::SendHttpInternalError";
583
584 std::string body_to_send = body + "\r\n";
585
586 std::ostringstream out;
587 out << "HTTP/1.1 500 Internal Server Error\r\n"
588 << "Content-Length: " << strlen(body_to_send.c_str()) << "\r\n"
589 << "Content-Type: application/json; charset=utf-8\r\n"
590 << "Cache-Control: no-cache\r\n"
591 << "Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept\r\n"
592 << "Accept-Ranges: bytes\r\n\r\n";
593 if (strcmp(request_info->request_method, "HEAD") != 0) {
594 out << body_to_send;
595 }
596
597 mg_write(connection, out.str().c_str(), out.str().size());
598}
599
600void Server::SendHttpNotFound(struct mg_connection* const connection,
601 const struct mg_request_info* request_info,

Callers 1

SendResponseToClientMethod · 0.95

Calls 2

LOGClass · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected