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) <noreply@anthropic.com>
This commit is contained in:
lwoodard
2026-08-12 09:50:15 -06:00
parent d1d5d88508
commit cef6f72712
2 changed files with 12 additions and 12 deletions

View File

@@ -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: