Repository navigation
Replies: 2 comments
|
@ehsandeep question here. I imagine the issue is the character isn't escaped somewhere. Could you help? |
0 replies
|
This is a known issue — notify doesn't escape special characters in Workarounds:
echo 'data with "quotes"' | sed 's/"/\\"/g' | notify -provider-config config.yaml
#!/bin/bash
while IFS= read -r line; do
# Escape JSON special characters
escaped=$(echo "$line" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read().strip())[1:-1])")
echo "$escaped"
done | notify -provider-config config.yaml
custom:
- id: webhook
custom_webhook_url: https://hooks.chime.aws/XXXXX
custom_method: POST
custom_format: '{"Content":{{dataJsonString}}}'
custom_headers:
Content-Type: application/jsonCheck if your version supports
custom:
- id: webhook
custom_webhook_url: https://hooks.chime.aws/XXXXX
custom_method: POST
custom_format: 'Content={{data}}'
custom_headers:
Content-Type: application/x-www-form-urlencodedThis avoids JSON entirely — form-encoded data handles special characters better. The real fix should be in notify's codebase — |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm configure aws chime webhook to receive message. here is the provider-config.yaml
Everything works well unless Input data has a
"(would post wrong json)eg:
input:
the server got wrong json package.
Any ideas to solve it?
Thanks!
All reactions