fixed GH #1235: Poco::Net::HTTPClientSession::sendRequest() should also handle HTTP_PATCH

This commit is contained in:
Guenter Obiltschnig 2016-04-11 10:44:08 +02:00
parent 9d425d73e1
commit 86969b4a91

View File

@ -220,6 +220,7 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
}
_reconnect = keepAlive;
_expectResponseBody = request.getMethod() != HTTPRequest::HTTP_HEAD;
const std::string& method = request.getMethod();
if (request.getChunkedTransferEncoding())
{
HTTPHeaderOutputStream hos(*this);
@ -237,7 +238,7 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
#endif
request.write(*_pRequestStream);
}
else if ((request.getMethod() != HTTPRequest::HTTP_PUT && request.getMethod() != HTTPRequest::HTTP_POST) || request.has(HTTPRequest::UPGRADE))
else if ((method != HTTPRequest::HTTP_PUT && method != HTTPRequest::HTTP_POST && method != HTTPRequest::HTTP_PATCH) || request.has(HTTPRequest::UPGRADE))
{
Poco::CountingOutputStream cs;
request.write(cs);