10 #include "AllowNothingService.hpp" 11 #include <pion/config.hpp> 12 #include <pion/http/response_writer.hpp> 22 static const std::string DENY_HTML =
"<html><body>No, you can't.</body></html>";
25 writer->get_response().set_status_code(http::types::RESPONSE_CODE_METHOD_NOT_ALLOWED);
26 writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED);
32 writer->get_response().add_header(
"Allow",
"GET");
34 writer->write_no_copy(DENY_HTML);
35 writer->write_no_copy(http::types::STRING_CRLF);
36 writer->write_no_copy(http::types::STRING_CRLF);
static boost::shared_ptr< response_writer > create(const tcp::connection_ptr &tcp_conn, const http::response_ptr &http_response_ptr, finished_handler_t handler=finished_handler_t())
virtual void operator()(const pion::http::request_ptr &http_request_ptr, const pion::tcp::connection_ptr &tcp_conn)