Merge pull request #2151

13a8d64f epee: don't send the body of the response to a HEAD HTTP request (Guillaume LE VAILLANT)
This commit is contained in:
Riccardo Spagni 2017-08-07 15:06:45 +02:00
commit 6244c782de
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -547,7 +547,7 @@ namespace net_utils
LOG_PRINT_L3("HTTP_RESPONSE_HEAD: << \r\n" << response_data);
m_psnd_hndlr->do_send((void*)response_data.data(), response_data.size());
if(response.m_body.size())
if(response.m_body.size() && (query_info.m_http_method != http::http_method_head))
m_psnd_hndlr->do_send((void*)response.m_body.data(), response.m_body.size());
return res;
}