mirror of https://gitee.com/bigwinds/arangodb
do not send a content-length header on GET/HEAD/DELETE requests
This commit is contained in:
parent
b159a0539b
commit
c315c4466d
|
@ -259,9 +259,19 @@ namespace triagens {
|
||||||
_writeBuffer.appendText("\r\n");
|
_writeBuffer.appendText("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
_writeBuffer.appendText("Content-Length: ");
|
if (method == HttpRequest::HTTP_REQUEST_GET ||
|
||||||
_writeBuffer.appendInteger(bodyLength);
|
method == HttpRequest::HTTP_REQUEST_HEAD ||
|
||||||
_writeBuffer.appendText("\r\n\r\n");
|
method == HttpRequest::HTTP_REQUEST_DELETE) {
|
||||||
|
// don't use a content-length for these request types
|
||||||
|
_writeBuffer.appendText("\r\n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// use a content-length for these request types
|
||||||
|
_writeBuffer.appendText("Content-Length: ");
|
||||||
|
_writeBuffer.appendInteger(bodyLength);
|
||||||
|
_writeBuffer.appendText("\r\n\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
_writeBuffer.appendText(body, bodyLength);
|
_writeBuffer.appendText(body, bodyLength);
|
||||||
|
|
||||||
LOGGER_TRACE << "Request: " << _writeBuffer.c_str();
|
LOGGER_TRACE << "Request: " << _writeBuffer.c_str();
|
||||||
|
|
Loading…
Reference in New Issue