From 14f0012b129004856aa864443de820f32573865d Mon Sep 17 00:00:00 2001 From: Rasmus Eskola Date: Mon, 21 Apr 2014 16:36:06 +0300 Subject: [PATCH] url service improvements: - support POST method at user's preference - support basic HTTP auth (uses "user" and "secret" for username/password) --- push.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/push.cpp b/push.cpp index ee3915f..0bfc50b 100755 --- a/push.cpp +++ b/push.cpp @@ -132,6 +132,7 @@ class CPushMod : public CModule defaults["message_length"] = "100"; defaults["message_title"] = "{title}"; defaults["message_uri"] = ""; + defaults["message_uri_post"] = "no"; defaults["message_uri_title"] = ""; defaults["message_priority"] = "0"; defaults["message_sound"] = ""; @@ -453,7 +454,10 @@ class CPushMod : public CModule return; } - use_post = false; + if(options["message_uri_post"] != "yes") + { + use_post = false; + } if (parts[0] == "https") { @@ -471,6 +475,12 @@ class CPushMod : public CModule return; } + // HTTP basic auth + if(options["username"] != "") + { + service_auth = options["username"] + CString(":") + options["secret"]; + } + // Process the remaining portion of the URL url = parts[1];