mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-22 00:59:08 +01:00
* HTTPProxy.cpp : HTTP error message cleanup
This commit is contained in:
parent
dde53ea4ba
commit
d8906f508c
1 changed files with 7 additions and 3 deletions
|
@ -114,12 +114,16 @@ namespace proxy
|
||||||
|
|
||||||
void HTTPProxyHandler::RedirectToJumpService(/*HTTPProxyHandler::errTypes error*/)
|
void HTTPProxyHandler::RedirectToJumpService(/*HTTPProxyHandler::errTypes error*/)
|
||||||
{
|
{
|
||||||
std::stringstream response;
|
std::stringstream ss;
|
||||||
std::string httpAddr; i2p::config::GetOption("http.address", httpAddr);
|
std::string httpAddr; i2p::config::GetOption("http.address", httpAddr);
|
||||||
uint16_t httpPort; i2p::config::GetOption("http.port", httpPort);
|
uint16_t httpPort; i2p::config::GetOption("http.port", httpPort);
|
||||||
|
|
||||||
response << "HTTP/1.1 302 Found\r\nLocation: http://" << httpAddr << ":" << httpPort << "/?page=jumpservices&address=" << m_address << "\r\n\r\n";
|
ss << "HTTP/1.1 302 Found\r\n"
|
||||||
boost::asio::async_write(*m_sock, boost::asio::buffer(response.str (),response.str ().length ()),
|
<< "Connection: close\r\n"
|
||||||
|
<< "Location: http://" << httpAddr << ":" << httpPort << "/?page=jumpservices&address=" << m_address << "\r\n"
|
||||||
|
<< "\r\n";
|
||||||
|
std::string response = ss.str();
|
||||||
|
boost::asio::async_write(*m_sock, boost::asio::buffer(response),
|
||||||
std::bind(&HTTPProxyHandler::SentHTTPFailed, shared_from_this(), std::placeholders::_1));
|
std::bind(&HTTPProxyHandler::SentHTTPFailed, shared_from_this(), std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue