summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-06-06 16:02:54 +0200
committerlassulus <lassulus@lassul.us>2022-06-06 16:02:54 +0200
commit8974ebb86450941b8db50765f6ee52057eb6d34b (patch)
tree0cd6d7709df7150bff98e0c42d82583d6ff4f25e
parent2bb08f9cef428b7e7ac9864eea30a74984aea693 (diff)
l radio news: survive newline in input
-rw-r--r--lass/2configs/radio/news.nix4
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'