mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* Use UTF-8 charset in content-type header
* Add changelog fragment
(cherry picked from commit a4ab85fd68
)
Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
This commit is contained in:
parent
7b4660d28a
commit
f9919d28d4
2 changed files with 4 additions and 2 deletions
2
changelogs/fragments/3933-slack-charset-header.yaml
Normal file
2
changelogs/fragments/3933-slack-charset-header.yaml
Normal 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).
|
|
@ -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):
|
def get_slack_message(module, token, channel, ts):
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Authorization': 'Bearer ' + token
|
'Authorization': 'Bearer ' + token
|
||||||
}
|
}
|
||||||
|
@ -383,7 +383,7 @@ def do_notify_slack(module, domain, token, payload):
|
||||||
slack_uri = OLD_SLACK_INCOMING_WEBHOOK % (domain, token)
|
slack_uri = OLD_SLACK_INCOMING_WEBHOOK % (domain, token)
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
}
|
}
|
||||||
if use_webapi:
|
if use_webapi:
|
||||||
|
|
Loading…
Reference in a new issue