slack - use UTF-8 charset in content-type header (#3933)

* Use UTF-8 charset in content-type header

* Add changelog fragment
pull/3965/head
bluikko 2022-01-04 01:23:27 +07:00 committed by GitHub
parent e4882b3a3f
commit a4ab85fd68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -0,0 +1,2 @@
bugfixes:
- slack - add ``charset`` to HTTP headers to avoid Slack API warning (https://github.com/ansible-collections/community.general/issues/3932).

View File

@ -346,7 +346,7 @@ def build_payload_for_slack(text, channel, thread_id, username, icon_url, icon_e
def get_slack_message(module, token, channel, ts):
headers = {
'Content-Type': 'application/json',
'Content-Type': 'application/json; charset=UTF-8',
'Accept': 'application/json',
'Authorization': 'Bearer ' + token
}
@ -383,7 +383,7 @@ def do_notify_slack(module, domain, token, payload):
slack_uri = OLD_SLACK_INCOMING_WEBHOOK % (domain, token)
headers = {
'Content-Type': 'application/json',
'Content-Type': 'application/json; charset=UTF-8',
'Accept': 'application/json',
}
if use_webapi: