From c62c1b9d92f6a49f57ae6dcb83893357e50139f8 Mon Sep 17 00:00:00 2001 From: y00916259 Date: Mon, 16 Jun 2025 19:59:24 +0800 Subject: [PATCH] fix: The HTTP request node supports non-standard spaces in JSON request data --- api/core/workflow/nodes/http_request/executor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/core/workflow/nodes/http_request/executor.py b/api/core/workflow/nodes/http_request/executor.py index 2c83b00d4a..235663d6b8 100644 --- a/api/core/workflow/nodes/http_request/executor.py +++ b/api/core/workflow/nodes/http_request/executor.py @@ -1,5 +1,6 @@ import base64 import json +import re import secrets import string from collections.abc import Mapping @@ -177,6 +178,9 @@ class Executor: if len(data) != 1: raise RequestBodyError("json body type should have exactly one item") json_string = self.variable_pool.convert_template(data[0].value).text + # Compatible with non-standard spaces + pattern = r"[\u00a0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000]" + json_string = re.sub(pattern, " ", json_string) try: json_object = json.loads(json_string, strict=False) except json.JSONDecodeError as e: