in read_headers (http_client.cpp):
ctx->m_needChunked = boost::iequals(value, U("chunked"));
Above statement will not always work because some site somehow inserts an additional space before the "chunked"
test:
www.cnn.com, "chunked"
news.cnet.com, " chunked"
A dummy workaround (didn't know how to easily trim):
ctx->m_needChunked = boost::iequals(value, U("chunked")); //original
if(!ctx->m_needChunked)
ctx->m_needChunked = boost::iequals(value, U(" chunked")); //additional check
This fixes the issue for this particular case (not sure if similar issue exist for other type of detection).
Comments: Easiest way would be: ``` ctx->m_needChunked = boost::iequals(boost::trim_copy(value), U("chunked")); ``` downside to this is that it requires the string to be copied, whereas a custom comparison could just ignore the trailing and leading spaces (i suppose icontains could be used instead of iequals, but that would match such strings as "not-chunked", which isn't valid, but you get the idea).
ctx->m_needChunked = boost::iequals(value, U("chunked"));
Above statement will not always work because some site somehow inserts an additional space before the "chunked"
test:
www.cnn.com, "chunked"
news.cnet.com, " chunked"
A dummy workaround (didn't know how to easily trim):
ctx->m_needChunked = boost::iequals(value, U("chunked")); //original
if(!ctx->m_needChunked)
ctx->m_needChunked = boost::iequals(value, U(" chunked")); //additional check
This fixes the issue for this particular case (not sure if similar issue exist for other type of detection).
Comments: Easiest way would be: ``` ctx->m_needChunked = boost::iequals(boost::trim_copy(value), U("chunked")); ``` downside to this is that it requires the string to be copied, whereas a custom comparison could just ignore the trailing and leading spaces (i suppose icontains could be used instead of iequals, but that would match such strings as "not-chunked", which isn't valid, but you get the idea).