| 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 ()), |
nothing calls this directly
no test coverage detected