10 #include "AllowNothingService.hpp"
11 #include <pion/PionConfig.hpp>
12 #include <pion/net/HTTPResponseWriter.hpp>
21 void AllowNothingService::operator()(HTTPRequestPtr& request, TCPConnectionPtr& tcp_conn)
23 static const std::string DENY_HTML =
"<html><body>No, you can't.</body></html>";
26 writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_METHOD_NOT_ALLOWED);
27 writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED);
33 writer->getResponse().addHeader(
"Allow",
"GET");
35 writer->writeNoCopy(DENY_HTML);
36 writer->writeNoCopy(HTTPTypes::STRING_CRLF);
37 writer->writeNoCopy(HTTPTypes::STRING_CRLF);
the following enables use of the lock-free cache
static boost::shared_ptr< HTTPResponseWriter > create(TCPConnectionPtr &tcp_conn, HTTPResponsePtr &http_response, FinishedHandler handler=FinishedHandler())