From ab33115c106bbb344dde3066acf6887af83c3cee Mon Sep 17 00:00:00 2001 From: Justin Karneges Date: Mon, 29 Jun 2015 07:53:26 -0700 Subject: [PATCH] if we know the content length, set it here if >0 --- src/worker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/worker.cpp b/src/worker.cpp index a83a883..2415523 100644 --- a/src/worker.cpp +++ b/src/worker.cpp @@ -387,6 +387,9 @@ class Worker::Private : public QObject if(transport == HttpTransport) { + if(!request.body.isEmpty() && !request.more && !headers.contains("Content-Length")) + headers += HttpHeader("Content-Length", QByteArray::number(request.body.size())); + bool hasOrMightHaveBody = (!request.body.isEmpty() || request.more); hreq->start(request.method, request.uri, headers, hasOrMightHaveBody);