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 c8967793d8
commit 65abed223d

View File

@ -214,6 +214,7 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
} }
_reconnect = keepAlive; _reconnect = keepAlive;
_expectResponseBody = request.getMethod() != HTTPRequest::HTTP_HEAD; _expectResponseBody = request.getMethod() != HTTPRequest::HTTP_HEAD;
const std::string& method = request.getMethod();
if (request.getChunkedTransferEncoding()) if (request.getChunkedTransferEncoding())
{ {
HTTPHeaderOutputStream hos(*this); HTTPHeaderOutputStream hos(*this);
@ -231,7 +232,7 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
#endif #endif
request.write(*_pRequestStream); 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; Poco::CountingOutputStream cs;
request.write(cs); request.write(cs);