diff --git a/daemon/I2PControl.cpp b/daemon/I2PControl.cpp index c24c6eb2..95badb8a 100644 --- a/daemon/I2PControl.cpp +++ b/daemon/I2PControl.cpp @@ -15,6 +15,7 @@ // Use global placeholders from boost introduced when local_time.hpp is loaded #define BOOST_BIND_GLOBAL_PLACEHOLDERS #include +#include #include "FS.h" #include "Log.h" @@ -247,12 +248,8 @@ namespace client { std::getline(ss, header); auto colon = header.find (':'); - if (colon != std::string::npos) - { - auto name = header.substr (0, colon); - if (name == "Content-Length" || name == "content-length") - contentLength = std::stoi (header.substr (colon + 1)); - } + if (colon != std::string::npos && boost::iequals (header.substr (0, colon), "Content-Length")) + contentLength = std::stoi (header.substr (colon + 1)); } if (ss.eof ()) {