MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / SendReply

Method SendReply

daemon/HTTPServer.cpp:1593–1604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1591 }
1592
1593 void HTTPConnection::SendReply (HTTPRes& reply, std::string& content)
1594 {
1595 reply.add_header("X-Frame-Options", "SAMEORIGIN");
1596 reply.add_header("X-Content-Type-Options", "nosniff");
1597 reply.add_header("X-XSS-Protection", "1; mode=block");
1598 reply.add_header("Content-Type", "text/html");
1599 reply.body = content;
1600
1601 m_SendBuffer = reply.to_string();
1602 boost::asio::async_write (*m_Socket, boost::asio::buffer(m_SendBuffer), boost::asio::transfer_all (),
1603 std::bind (&HTTPConnection::Terminate, shared_from_this (), std::placeholders::_1));
1604 }
1605
1606 HTTPServer::HTTPServer (const std::string& address, int port):
1607 m_IsRunning (false), m_Thread (nullptr), m_Work (m_Service.get_executor ()),

Callers

nothing calls this directly

Calls 2

add_headerMethod · 0.80
to_stringMethod · 0.80

Tested by

no test coverage detected