feedpushr icon indicating copy to clipboard operation
feedpushr copied to clipboard

How to configure webhooks with Gotify ?

Open spysir opened this issue 2 years ago • 2 comments

  • Target URL: https://push.xxx.com/message?token=XXXXXIEEO7hrhQ
  • Content Type: JSON
  • Payload:
{
  "title": "[feedpushr]",
  "message": "{{.Content}}",
  "priority": 8
}

It didn't work !

spysir avatar Feb 25 '23 07:02 spysir

Did the content contain quotation marks? If so, you need to escape them by using the escapes functions such as {{ .Content | html }} or {{ .Content | js }} or {{ .Content | urlquery }} (see: https://pkg.go.dev/text/template#hdr-Functions)

ncarlier avatar Feb 25 '23 07:02 ncarlier

A better option in this case would be to filter .Content with {{.Content | printf "%q"}} as this will produce a quoted string with all encapsulated quotes properly escaped.

StaticRocket avatar Dec 10 '23 06:12 StaticRocket