Loading client/publishclient.cpp +11 −6 Changes for client/publishclient.cpp: 11 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -155,16 +155,21 @@ void PublishClient::publish(const QString &html, Callback cb) { QNetworkRequest req(url); req.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); req.setAttribute(QNetworkRequest::Http2AllowedAttribute, false); if (!_authToken.isEmpty()) { req.setRawHeader("Cookie", ("authid=" + _authToken).toUtf8()); } QJsonArray commands; /* Publish the rendered HTML to the server */ /* First command: authenticate with authid */ if (!_authToken.isEmpty()) { QJsonObject authCmd; authCmd["authid"] = _authToken; commands.append(authCmd); } /* Second command: publish the rendered HTML via webedit */ QJsonObject pubCmd; pubCmd["command"] = "publish_html"; pubCmd["html"] = html; QJsonObject pubParams; pubParams["html"] = html; pubCmd["publish"] = pubParams; commands.append(pubCmd); QJsonDocument doc(commands); Loading Loading
client/publishclient.cpp +11 −6 Changes for client/publishclient.cpp: 11 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -155,16 +155,21 @@ void PublishClient::publish(const QString &html, Callback cb) { QNetworkRequest req(url); req.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); req.setAttribute(QNetworkRequest::Http2AllowedAttribute, false); if (!_authToken.isEmpty()) { req.setRawHeader("Cookie", ("authid=" + _authToken).toUtf8()); } QJsonArray commands; /* Publish the rendered HTML to the server */ /* First command: authenticate with authid */ if (!_authToken.isEmpty()) { QJsonObject authCmd; authCmd["authid"] = _authToken; commands.append(authCmd); } /* Second command: publish the rendered HTML via webedit */ QJsonObject pubCmd; pubCmd["command"] = "publish_html"; pubCmd["html"] = html; QJsonObject pubParams; pubParams["html"] = html; pubCmd["publish"] = pubParams; commands.append(pubCmd); QJsonDocument doc(commands); Loading