mirror of https://github.com/SeanOMik/znc-push.git
Remove support for deprecated PushBullet API
This also moves the call to Base64Encode, which fixes #70 by preventing a double-encoding of the auth string when building with support for libcurl instead of csocket. The base64 encoding is now done in the csocket request, where it is still required to operate correctly.
This commit is contained in:
parent
84cf52fdf1
commit
9d7e6ea8f2
14
push.cpp
14
push.cpp
|
@ -277,16 +277,8 @@ class CPushMod : public CModule
|
|||
|
||||
// BASIC auth, base64-encoded APIKey:
|
||||
service_auth = options["secret"] + CString(":");
|
||||
service_auth.Base64Encode();
|
||||
|
||||
// Pushbullet uses numeric device_id but they
|
||||
// are transitioning to an alphanumeric device_iden
|
||||
if (is_number(options["target"]))
|
||||
{
|
||||
params["device_id"] = options["target"];
|
||||
} else {
|
||||
params["device_iden"] = options["target"];
|
||||
}
|
||||
params["device_iden"] = options["target"];
|
||||
params["type"] = "note";
|
||||
params["title"] = message_title;
|
||||
params["body"] = message_content;
|
||||
|
@ -1649,7 +1641,9 @@ void CPushSocket::Request(bool post, const CString& host, const CString& url, MC
|
|||
|
||||
if (auth != "")
|
||||
{
|
||||
request += "Authorization: Basic " + auth + crlf;
|
||||
CString auth_b64 = auth.Base64Encode_n();
|
||||
request += "Authorization: Basic " + auth_b64 + crlf;
|
||||
parent->PutDebug("Authorization: Basic " + auth_b64);
|
||||
}
|
||||
|
||||
request += crlf;
|
||||
|
|
Loading…
Reference in New Issue