diff options
author | makefu <github@syntax-fehler.de> | 2022-04-27 22:07:43 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2022-04-27 22:07:43 +0200 |
commit | bdd36774f5e0854553b13433ef85260c6c074b3e (patch) | |
tree | 656d0a2755c098a9e69c373a8c4f39fa82cb8d1e /lass/2configs/fysiirc.nix | |
parent | c3adb252afa29f0140f29c935201cfbb100b5697 (diff) | |
parent | 92d5eacd6d9e530c4d1ea0dec2652417b0fde78a (diff) |
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'lass/2configs/fysiirc.nix')
-rw-r--r-- | lass/2configs/fysiirc.nix | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lass/2configs/fysiirc.nix b/lass/2configs/fysiirc.nix index f3c1d5b7c..e12eda42e 100644 --- a/lass/2configs/fysiirc.nix +++ b/lass/2configs/fysiirc.nix @@ -54,14 +54,20 @@ in { name = "reaktor2-fysiweb-github"; }; script = ''. ${pkgs.writeDash "github-irc" '' - set -efu + set -xefu case "$Method $Request_URI" in "POST /") - payload=$(head -c "$req_content_length" \ - | sed 's/+/ /g;s/%\(..\)/\\x\1/g;' \ - | xargs -0 echo -e \ - ) - echo "$payload" | ${format-github-message}/bin/format-github-message + payload=$(head -c "$req_content_length") + echo "$payload" >&2 + payload2=$payload + payload2=$(echo "$payload" | tr '\n' ' ' | tr -d '\r') + if [ "$payload" != "$payload2" ]; then + echo "payload has been mangled" >&2 + else + echo "payload not mangled" >&2 + fi + echo "$payload2" > /tmp/last_fysi_payload + echo "$payload2" | ${format-github-message}/bin/format-github-message printf 'HTTP/1.1 200 OK\r\n' printf 'Connection: close\r\n' printf '\r\n' |