mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-11-23 11:49:19 +01:00
Make sure clear= values are checked
This commit is contained in:
parent
882f027f6c
commit
9c91ae2744
1 changed files with 3 additions and 0 deletions
|
@ -126,6 +126,9 @@ func parseActionsFromSimple(s string) ([]*action, error) {
|
||||||
newAction.Label = value
|
newAction.Label = value
|
||||||
case "clear":
|
case "clear":
|
||||||
lvalue := strings.ToLower(value)
|
lvalue := strings.ToLower(value)
|
||||||
|
if !util.InStringList([]string{"true", "yes", "1", "false", "no", "0"}, lvalue) {
|
||||||
|
return nil, wrapErrHTTP(errHTTPBadRequestActionsInvalid, "'clear=%s' not allowed", value)
|
||||||
|
}
|
||||||
newAction.Clear = lvalue == "true" || lvalue == "yes" || lvalue == "1"
|
newAction.Clear = lvalue == "true" || lvalue == "yes" || lvalue == "1"
|
||||||
case "url":
|
case "url":
|
||||||
newAction.URL = value
|
newAction.URL = value
|
||||||
|
|
Loading…
Reference in a new issue