diff options
author | George Hazan <ghazan@miranda.im> | 2017-06-05 15:16:22 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-06-05 15:16:22 +0300 |
commit | a988d6727c150db41c5bfb222190d147b98f3b68 (patch) | |
tree | 43d202eaafa4536d8ba6aa3382903472e1268be8 /protocols/Discord/src/connection.cpp | |
parent | 9a80a756aa3bee92b85e09466b234c4c26c744b4 (diff) |
Discord: attempt to fix problems with unauthorized http requests
Diffstat (limited to 'protocols/Discord/src/connection.cpp')
-rw-r--r-- | protocols/Discord/src/connection.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/protocols/Discord/src/connection.cpp b/protocols/Discord/src/connection.cpp index ae8da49d97..3d1ad8e83a 100644 --- a/protocols/Discord/src/connection.cpp +++ b/protocols/Discord/src/connection.cpp @@ -36,6 +36,8 @@ void CDiscordProto::ExecuteRequest(AsyncHttpRequest *pReq) if (pReq->m_bMainSite) { pReq->flags |= NLHRF_PERSISTENT; pReq->nlc = m_hAPIConnection; + if (m_szAccessCookie) + pReq->AddHeader("Cookie", m_szAccessCookie); } debugLogA("Executing request #%d:\n%s", pReq->m_iReqNum, pReq->szUrl); @@ -44,7 +46,8 @@ void CDiscordProto::ExecuteRequest(AsyncHttpRequest *pReq) if (pReq->m_pCallback != nullptr) (this->*(pReq->m_pCallback))(reply, pReq); - m_hAPIConnection = reply->nlc; + if (pReq->m_bMainSite) + m_hAPIConnection = reply->nlc; Netlib_FreeHttpRequest(reply); } |