Skip to content

Commit

Permalink
fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Aug 1, 2024
1 parent a4ad4c0 commit 2c289a4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api/tacticalrmm/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def find_and_replace_db_values_str(*, text: str, instance):
# but preserves newlines or tabs
# removes all control chars
def _sanitize_webhook(s: str) -> str:
s = re.sub(r"[\x00-\x1f\x7f-\x9f]", " ", s)
s = re.sub(r"[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]", " ", s)
s = re.sub(r"(?<!\\)(\\)(?![\\nrt])", r"\\\\", s)
return s

Expand All @@ -250,7 +250,6 @@ def _run_url_rest_action(*, url: str, method, body: str, headers: str, instance=
new_url = requote_uri(new_url)

new_body = _sanitize_webhook(new_body)

try:
new_body = json.loads(new_body, strict=False)
except Exception as e:
Expand Down

0 comments on commit 2c289a4

Please sign in to comment.