From cef6f72712d5519f0462e8acf0ca0112c110a67a Mon Sep 17 00:00:00 2001 From: lwoodard <92559124+WoodardDigital@users.noreply.github.com> Date: Wed, 12 Aug 2026 09:50:15 -0600 Subject: [PATCH] Slack modules: declare charset in Content-Type Add "; charset=utf-8" to the JSON Content-Type header so Slack's users.profile.set no longer returns the missing_charset warning. Co-Authored-By: Claude Opus 4.8 (1M context) --- internal/defaults/modules.example.yaml | 12 ++++++------ modules.example.yaml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/defaults/modules.example.yaml b/internal/defaults/modules.example.yaml index 19f1a32..f8749de 100644 --- a/internal/defaults/modules.example.yaml +++ b/internal/defaults/modules.example.yaml @@ -13,14 +13,14 @@ modules: exec: | curl -s -X POST https://slack.com/api/users.profile.set \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"profile":{"status_emoji":"{{.emoji}}","status_text":"{{.text}}","status_expiration":{{expiry .expiry}}}}' clear_status: exec: | curl -s -X POST https://slack.com/api/users.profile.set \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"profile":{"status_emoji":"","status_text":"","status_expiration":0}}' set_presence: @@ -29,7 +29,7 @@ modules: exec: | curl -s -X POST https://slack.com/api/users.setPresence \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"presence":"{{.presence}}"}' snooze: @@ -38,18 +38,18 @@ modules: exec: | curl -s -X POST https://slack.com/api/dnd.setSnooze \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"num_minutes":{{.minutes}}}' go_offline: exec: | curl -s -X POST https://slack.com/api/users.setPresence \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"presence":"away"}' && \ curl -s -X POST https://slack.com/api/users.profile.set \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"profile":{"status_emoji":":dumpsterfire:","status_text":"Offline","status_expiration":0}}' end_snooze: diff --git a/modules.example.yaml b/modules.example.yaml index 47b6fcb..14859d2 100644 --- a/modules.example.yaml +++ b/modules.example.yaml @@ -13,14 +13,14 @@ modules: exec: | curl -s -X POST https://slack.com/api/users.profile.set \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"profile":{"status_emoji":"{{.emoji}}","status_text":"{{.text}}","status_expiration":{{expiry .expiry}}}}' clear_status: exec: | curl -s -X POST https://slack.com/api/users.profile.set \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"profile":{"status_emoji":"","status_text":"","status_expiration":0}}' set_presence: @@ -29,7 +29,7 @@ modules: exec: | curl -s -X POST https://slack.com/api/users.setPresence \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"presence":"{{.presence}}"}' snooze: @@ -38,18 +38,18 @@ modules: exec: | curl -s -X POST https://slack.com/api/dnd.setSnooze \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"num_minutes":{{.minutes}}}' go_offline: exec: | curl -s -X POST https://slack.com/api/users.setPresence \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"presence":"away"}' && \ curl -s -X POST https://slack.com/api/users.profile.set \ -H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json; charset=utf-8" \ -d '{"profile":{"status_emoji":":dumpsterfire:","status_text":"Offline","status_expiration":0}}' end_snooze: