Fixed #846. httpproxy.addresshelper config parameter added

This commit is contained in:
orignal 2017-04-11 14:36:28 -04:00
parent 539bf482b9
commit 7a67670e1a
2 changed files with 10 additions and 1 deletions

View file

@ -237,7 +237,15 @@ namespace proxy {
LogPrint(eLogDebug, "HTTPProxy: requested: ", m_ClientRequest.uri);
m_RequestURL.parse(m_ClientRequest.uri);
if (ExtractAddressHelper(m_RequestURL, b64)) {
if (ExtractAddressHelper(m_RequestURL, b64))
{
bool addresshelper; i2p::config::GetOption("httpproxy.addresshelper", addresshelper);
if (!addresshelper)
{
LogPrint(eLogWarning, "HTTPProxy: addresshelper disabled");
GenericProxyError("Invalid request", "adddresshelper is not supported");
return true;
}
i2p::client::context.GetAddressBook ().InsertAddress (m_RequestURL.host, b64);
LogPrint (eLogInfo, "HTTPProxy: added b64 from addresshelper for ", m_RequestURL.host);
std::string full_url = m_RequestURL.to_string();