Skip to content

Commit

Permalink
if we know the content length, set it here if >0
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Karneges committed Jun 29, 2015
1 parent 5278f50 commit ab33115
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/worker.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit ab33115

Please sign in to comment.