Skip to content

Commit 83e0dae

Browse files
committed
Use json loads/dumps to prevent encoding aleas
1 parent d0f2bda commit 83e0dae

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
@@ -408,12 +408,15 @@ def send(self, structured_msg: str) -> bool:
408408
409409
:rtype: bool
410410
"""
411+
# load the message to ensure encoding
412+
msg_json = json.loads(structured_msg)
413+
411414
with Session() as requests_session:
412415

413416
# send requests
414417
response = requests_session.post(
415418
url=self.wh_url,
416-
data=structured_msg,
419+
json=json.dumps(msg_json),
417420
headers={
418421
"Content-Type": "application/json",
419422
"User-Agent": "Isso/{0} (+https://posativ.org/isso)".format(

0 commit comments

Comments
 (0)