Skip to content

Commit

Permalink
Encode POST style requests and notifications as UTF-8 if it has no en…
Browse files Browse the repository at this point in the history
…coding/basic string (#2523)
  • Loading branch information
dgtlmoon authored Jul 27, 2024
1 parent d7e85ff commit 2fd762a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion changedetectionio/content_fetchers/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def run(self,
session.mount('file://', FileAdapter())

r = session.request(method=request_method,
data=request_body,
data=request_body.encode('utf-8') if type(request_body) is str else request_body,
url=url,
headers=request_headers,
timeout=timeout,
Expand Down
2 changes: 1 addition & 1 deletion changedetectionio/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def apprise_custom_api_call_wrapper(body, title, notify_type, *args, **kwargs):

r(results.get('url'),
auth=auth,
data=body,
data=body.encode('utf-8') if type(body) is str else body,
headers=headers,
params=params
)
Expand Down

0 comments on commit 2fd762a

Please sign in to comment.