Skip to content

Commit c6c46c1

Browse files
committed
Use json loads/dumps to prevent encoding aleas
1 parent 3cadaa4 commit c6c46c1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

isso/ext/notifications.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,15 @@ def send(self, structured_msg: str) -> bool:
382382
383383
:rtype: bool
384384
"""
385+
# load the message to ensure encoding
386+
msg_json = json.loads(structured_msg)
387+
385388
with Session() as requests_session:
386389

387390
# send requests
388391
response = requests_session.post(
389392
url=self.wh_url,
390-
data=structured_msg,
393+
json=json.dumps(msg_json),
391394
headers={
392395
"Content-Type": "application/json",
393396
"User-Agent": "Isso/{0} (+https://posativ.org/isso)".format(

0 commit comments

Comments
 (0)