Now that we have that global as_json_ we can use that for the content type.

This commit is contained in:
luckydonald 2021-01-17 22:29:18 +01:00
parent 11cfc50c8a
commit dc397e0183

View File

@ -39,8 +39,7 @@ void HttpStatConnection::wakeup() {
td::HttpHeaderCreator hc;
hc.init_status_line(200);
hc.set_keep_alive();
if (!content.empty() && content.data()[0] == '{') {
// https://t.me/TDLightChat/1462
if (as_json_) {
hc.set_content_type("application/json");
} else {
hc.set_content_type("text/plain");