url service improvements:

- support POST method at user's preference
- support basic HTTP auth (uses "user" and "secret" for
  username/password)
This commit is contained in:
Rasmus Eskola 2014-04-21 16:36:06 +03:00
parent 9d7e6ea8f2
commit 14f0012b12
1 changed files with 11 additions and 1 deletions

View File

@ -132,6 +132,7 @@ class CPushMod : public CModule
defaults["message_length"] = "100"; defaults["message_length"] = "100";
defaults["message_title"] = "{title}"; defaults["message_title"] = "{title}";
defaults["message_uri"] = ""; defaults["message_uri"] = "";
defaults["message_uri_post"] = "no";
defaults["message_uri_title"] = ""; defaults["message_uri_title"] = "";
defaults["message_priority"] = "0"; defaults["message_priority"] = "0";
defaults["message_sound"] = ""; defaults["message_sound"] = "";
@ -453,7 +454,10 @@ class CPushMod : public CModule
return; return;
} }
use_post = false; if(options["message_uri_post"] != "yes")
{
use_post = false;
}
if (parts[0] == "https") if (parts[0] == "https")
{ {
@ -471,6 +475,12 @@ class CPushMod : public CModule
return; return;
} }
// HTTP basic auth
if(options["username"] != "")
{
service_auth = options["username"] + CString(":") + options["secret"];
}
// Process the remaining portion of the URL // Process the remaining portion of the URL
url = parts[1]; url = parts[1];