mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
Merge pull request #141 from klondi/httpproxy
Force Connection: Close and allow http/1.1
This commit is contained in:
commit
88560d06a1
|
@ -74,8 +74,7 @@ namespace proxy
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HTTPProxyHandler::ValidateHTTPRequest() {
|
bool HTTPProxyHandler::ValidateHTTPRequest() {
|
||||||
if ( m_version != "HTTP/1.0" ) {
|
if ( m_version != "HTTP/1.0" && m_version != "HTTP/1.1" ) {
|
||||||
//TODO: we want to support 1.1 in the future
|
|
||||||
LogPrint(eLogError,"--- HTTP Proxy unsupported version: ", m_version);
|
LogPrint(eLogError,"--- HTTP Proxy unsupported version: ", m_version);
|
||||||
HTTPRequestFailed(); //TODO: send right stuff
|
HTTPRequestFailed(); //TODO: send right stuff
|
||||||
return false;
|
return false;
|
||||||
|
@ -93,6 +92,7 @@ namespace proxy
|
||||||
m_request += m_version;
|
m_request += m_version;
|
||||||
m_request.push_back('\r');
|
m_request.push_back('\r');
|
||||||
m_request.push_back('\n');
|
m_request.push_back('\n');
|
||||||
|
m_request.append("Connection: close\r\n");
|
||||||
m_request.append(reinterpret_cast<const char *>(http_buff),len);
|
m_request.append(reinterpret_cast<const char *>(http_buff),len);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue