fix incorrect content-length in API
This commit is contained in:
parent
bcc715e83e
commit
020ab11069
@ -39,14 +39,17 @@ void ApiServer::answerClient(QTcpSocket* socket, const HttpRequest& request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QByteArray reply_message = QSL("HTTP/1.0 200 OK \r\n"
|
QByteArray reply_message = QSL("HTTP/1.0 200 OK \r\n"
|
||||||
"Content-Type: application/json; charset=\"utf-8\"\r\n"
|
"Content-Type: application/json; charset=\"utf-8\"\r\n"
|
||||||
"Content-Length: %1"
|
"Content-Length: %1"
|
||||||
"\r\n\r\n"
|
"\r\n\r\n")
|
||||||
"%2")
|
.arg(QString::number(output_data.size()))
|
||||||
.arg(QString::number(output_data.size()), output_data)
|
|
||||||
.toLocal8Bit();
|
.toLocal8Bit();
|
||||||
|
|
||||||
|
reply_message += output_data;
|
||||||
|
|
||||||
|
IOFactory::writeFile("a.out", output_data);
|
||||||
|
|
||||||
socket->write(reply_message);
|
socket->write(reply_message);
|
||||||
socket->disconnectFromHost();
|
socket->disconnectFromHost();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user