Open hexabyte23 opened 6 years ago
void Socket::writeJson(const QJsonDocument &document, int statusCode) { QByteArray data = document.toJson(); setStatusCode(statusCode); setHeader("Content-Length", QByteArray::number(data.length())); setHeader("Content-Type", "application/json"); writeHeaders(); write(data); close(); }
According to my test, the headers are written just fine, though.
void Socket::writeJson(const QJsonDocument &document, int statusCode) { QByteArray data = document.toJson(); setStatusCode(statusCode); setHeader("Content-Length", QByteArray::number(data.length())); setHeader("Content-Type", "application/json"); writeHeaders(); write(data); close(); }