mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-26 21:14:42 +08:00
fix: Properly escape new line characters in webhook (#8054)
This commit is contained in:
@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user