fysiirc: escape, post raw json link
This commit is contained in:
parent
c776acea38
commit
0dddf50167
@ -10,8 +10,7 @@
|
|||||||
${write_to_irc} "$(echo "$INPUT" | jq -r '
|
${write_to_irc} "$(echo "$INPUT" | jq -r '
|
||||||
"\(.action): " +
|
"\(.action): " +
|
||||||
"[\(.issue.title // .pull_request.title)] " +
|
"[\(.issue.title // .pull_request.title)] " +
|
||||||
"\(.comment.html_url // .issue.html_url // .pull_request.html_url) " +
|
"\(.comment.html_url // .issue.html_url // .pull_request.html_url) "
|
||||||
"by \(.comment.user.login // .issue.user.login // .pull_request.user.login)"
|
|
||||||
')"
|
')"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
@ -58,16 +57,16 @@ in {
|
|||||||
case "$Method $Request_URI" in
|
case "$Method $Request_URI" in
|
||||||
"POST /")
|
"POST /")
|
||||||
payload=$(head -c "$req_content_length")
|
payload=$(head -c "$req_content_length")
|
||||||
echo "$payload" >&2
|
raw=$(printf '%s' "$payload" | ${pkgs.curl}/bin/curl --data-binary @- http://p.krebsco.de | tail -1)
|
||||||
payload2=$payload
|
payload2=$payload
|
||||||
payload2=$(echo "$payload" | tr '\n' ' ' | tr -d '\r')
|
payload2=$(printf '%s' "$payload" | tr '\n' ' ' | tr -d '\r')
|
||||||
if [ "$payload" != "$payload2" ]; then
|
if [ "$payload" != "$payload2" ]; then
|
||||||
echo "payload has been mangled" >&2
|
echo "payload has been mangled" >&2
|
||||||
else
|
else
|
||||||
echo "payload not mangled" >&2
|
echo "payload not mangled" >&2
|
||||||
fi
|
fi
|
||||||
echo "$payload2" > /tmp/last_fysi_payload
|
|
||||||
echo "$payload2" | ${format-github-message}/bin/format-github-message
|
echo "$payload2" | ${format-github-message}/bin/format-github-message
|
||||||
|
${write_to_irc} "$raw"
|
||||||
printf 'HTTP/1.1 200 OK\r\n'
|
printf 'HTTP/1.1 200 OK\r\n'
|
||||||
printf 'Connection: close\r\n'
|
printf 'Connection: close\r\n'
|
||||||
printf '\r\n'
|
printf '\r\n'
|
||||||
|
Loading…
Reference in New Issue
Block a user