diff options
author | lassulus <lassulus@lassul.us> | 2022-06-06 16:02:54 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2022-06-06 16:02:54 +0200 |
commit | 8974ebb86450941b8db50765f6ee52057eb6d34b (patch) | |
tree | 0cd6d7709df7150bff98e0c42d82583d6ff4f25e /lass/2configs/radio/news.nix | |
parent | 2bb08f9cef428b7e7ac9864eea30a74984aea693 (diff) |
l radio news: survive newline in input
Diffstat (limited to 'lass/2configs/radio/news.nix')
-rw-r--r-- | lass/2configs/radio/news.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lass/2configs/radio/news.nix b/lass/2configs/radio/news.nix index 99b58511d..d66da813f 100644 --- a/lass/2configs/radio/news.nix +++ b/lass/2configs/radio/news.nix @@ -108,8 +108,8 @@ in ;; "POST /") payload=$(head -c "$req_content_length") - echo "$payload" | jq 'has("from") and has("to") and has("text")' >&2 - echo "$payload" | jq -c '{ from: (.from | fromdate | todate), to: (.to | fromdate | todate), text: .text }' >> "$HOME"/news + printf '%s' "$payload" | jq 'has("from") and has("to") and has("text")' >&2 + printf '%s' "$payload" | jq -c '{ from: .from, to: .to, text: .text, priority: (.priority // 0)}' >> "$HOME"/news printf 'HTTP/1.1 200 OK\r\n' printf 'Connection: close\r\n' printf '\r\n' |