fix: Properly escape new line characters in webhook (#8054)
This commit is contained in:
parent
30ecf0c77c
commit
952633f4ca
1 changed files with 2 additions and 1 deletions
|
|
@ -43,7 +43,8 @@ class WebhookComponent(Component):
|
|||
self.status = "No data provided."
|
||||
return Data(data={})
|
||||
try:
|
||||
body = json.loads(self.data or "{}")
|
||||
my_data = self.data.replace('"\n"', '"\\n"')
|
||||
body = json.loads(my_data or "{}")
|
||||
except json.JSONDecodeError:
|
||||
body = {"payload": self.data}
|
||||
message = f"Invalid JSON payload. Please check the format.\n\n{self.data}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue