diff --git a/README.md b/README.md index 7967700..1c2decc 100755 --- a/README.md +++ b/README.md @@ -237,12 +237,18 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or This option must be set when using Boxcar or Pushover. + When using the custom URL service, if this option is set it will enable HTTP basic + authentication and be used as username. + * `secret = ""` Authentication token for push notifications. This option must be set when using Notify My Android, Pushover, Prowl, Supertoasty or PushBullet. + When using the custom URL service, if this option is set it will enable HTTP basic + authentication and be used as password. + * `target = ""` Device or target name for push notifications. @@ -281,6 +287,11 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or local scheme to access a mobile application. Keyword expansion is performed on this value. +* `message_uri_post = "no"` + + When using the custom URL service, this option allows you to specify whether to use the + POST method instead of GET. + * `message_uri_title` = ""` If you're using Pushover.net, you can specify a title for the `message_uri` option. diff --git a/push.cpp b/push.cpp index 664e5fa..2d7c08e 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"] = ""; @@ -472,7 +473,10 @@ class CPushMod : public CModule return; } - use_post = false; + if(options["message_uri_post"] != "yes") + { + use_post = false; + } if (parts[0] == "https") { @@ -490,6 +494,12 @@ class CPushMod : public CModule return; } + // HTTP basic auth + if(options["username"] != "" || options["secret"] != "") + { + service_auth = options["username"] + CString(":") + options["secret"]; + } + // Process the remaining portion of the URL url = parts[1];