| 199 | } |
| 200 | |
| 201 | void HTTPReqHandler::SendProxyError(std::string_view content) |
| 202 | { |
| 203 | i2p::http::HTTPRes res; |
| 204 | res.code = 500; |
| 205 | res.add_header("Content-Type", "text/html; charset=UTF-8"); |
| 206 | res.add_header("Connection", "close"); |
| 207 | std::stringstream ss; |
| 208 | ss << "<html>\r\n" << pageHead |
| 209 | << "<body>" << content << "</body>\r\n" |
| 210 | << "</html>\r\n"; |
| 211 | res.body = ss.str(); |
| 212 | m_Response = res.to_string(); |
| 213 | boost::asio::async_write(*m_sock, boost::asio::buffer(m_Response), boost::asio::transfer_all(), |
| 214 | std::bind(&HTTPReqHandler::SentHTTPFailed, shared_from_this(), std::placeholders::_1)); |
| 215 | } |
| 216 | |
| 217 | void HTTPReqHandler::SendRedirect(const std::string& address) |
| 218 | { |
nothing calls this directly
no test coverage detected