diff options
Diffstat (limited to 'protocols/Discord/src/http.cpp')
-rw-r--r-- | protocols/Discord/src/http.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/Discord/src/http.cpp b/protocols/Discord/src/http.cpp index 3e513ee8d0..ed154569d3 100644 --- a/protocols/Discord/src/http.cpp +++ b/protocols/Discord/src/http.cpp @@ -49,17 +49,17 @@ AsyncHttpRequest::AsyncHttpRequest(CDiscordProto *ppro, int iRequestType, LPCSTR else m_szUrl = _url; flags = NLHRF_HTTP11 | NLHRF_REDIRECT | NLHRF_SSL; - if (ppro->m_szAccessToken == NULL) - flags |= NLHRF_NODUMPSEND; - else + if (ppro->m_szAccessToken != NULL) { + AddHeader("Authorization", ppro->m_szAccessToken); flags |= NLHRF_DUMPASTEXT; + } + else flags |= NLHRF_NODUMPSEND; + AddHeader("Content-Type", "application/json"); if (pRoot != NULL) { ptrW text(json_write(pRoot)); pData = mir_utf8encodeW(text); dataLength = (int)mir_strlen(pData); - - AddHeader("Content-Type", "application/json"); } requestType = iRequestType; |