From e6fe149ed0269b963a285372c5adc9e35a972bfd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 30 Apr 2019 13:05:31 +0300 Subject: ICQ-WIM: explicit content-type specification for RAPI connections --- protocols/ICQ-WIM/src/http.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'protocols/ICQ-WIM/src') diff --git a/protocols/ICQ-WIM/src/http.cpp b/protocols/ICQ-WIM/src/http.cpp index d365b6e06e..693f320ca1 100644 --- a/protocols/ICQ-WIM/src/http.cpp +++ b/protocols/ICQ-WIM/src/http.cpp @@ -147,6 +147,7 @@ bool CIcqProto::ExecuteRequest(AsyncHttpRequest *pReq) if (pReq->m_conn == CONN_RAPI) { CMStringA szAgent(FORMAT, "%S Mail.ru Windows ICQ (version 10.0.1999)", (wchar_t*)m_szOwnId); pReq->AddHeader("User-Agent", szAgent); + pReq->AddHeader("Content-Type", "application/json"); if (m_szRToken.IsEmpty()) { if (!RefreshRobustToken()) { @@ -155,7 +156,8 @@ bool CIcqProto::ExecuteRequest(AsyncHttpRequest *pReq) } } - pReq->ReplaceJsonParam(JSONNode("clientId", m_iRClientId)); + if (m_iRClientId) + pReq->ReplaceJsonParam(JSONNode("clientId", m_iRClientId)); pReq->ReplaceJsonParam(JSONNode("authToken", m_szRToken)); pReq->dataLength = pReq->m_szParam.GetLength(); pReq->pData = mir_strdup(pReq->m_szParam); -- cgit v1.2.3