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

Method SendProxyError

libi2pd_client/HTTPProxy.cpp:201–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 2

add_headerMethod · 0.80
to_stringMethod · 0.80

Tested by

no test coverage detected