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

Method SendHttpMethodNotAllowed

cpp/webdriver-server/server.cc:621–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621void Server::SendHttpMethodNotAllowed(
622 struct mg_connection* connection,
623 const struct mg_request_info* request_info,
624 const std::string& allowed_methods,
625 const std::string& body) {
626 LOG(TRACE) << "Entering Server::SendHttpMethodNotAllowed";
627
628 std::string body_to_send = body + "\r\n";
629
630 std::ostringstream out;
631 out << "HTTP/1.1 405 Method Not Allowed\r\n"
632 << "Content-Type: text/html\r\n"
633 << "Content-Length: " << strlen(body_to_send.c_str()) << "\r\n"
634 << "Allow: " << allowed_methods << "\r\n\r\n";
635 if (strcmp(request_info->request_method, "HEAD") != 0) {
636 out << body_to_send;
637 }
638
639 mg_write(connection, out.str().c_str(), out.str().size());
640}
641
642void Server::SendHttpTimeout(struct mg_connection* connection,
643 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