langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
50.25k stars 7.2k forks source link

http_request node load json bug #10133

Open lyq518 opened 5 hours ago

lyq518 commented 5 hours ago

Self Checks

Dify version

0.10.2

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

1730377529446 Sometimes an error occurs when the json data contains line breaks, which did not exist in previous versions.

✔️ Expected Behavior

1730377733931

❌ Actual Behavior

No response

dosubot[bot] commented 5 hours ago

Hello @lyq518! I'm here to help you with any bugs, questions, or contributions you may have for Dify. Feel free to ask for assistance while waiting for a human maintainer.

I found a similar issue related to newline characters in JSON data within the HTTP request node. The issue titled 'Newline' not escaped when passed as string to HTTP request was closed, and the suggested solution was to manually escape newline characters in your input data or verify how the server interprets the received JSON payload. This ensures that newline characters are correctly understood by the server, aligning with the JSON specification's requirements for character escaping [1].

Additionally, the HTTP request node in Dify handles JSON data by parsing it through the _init_body method, where newline characters are managed by the json.loads function, which correctly parses them as part of the JSON data structure [2].

If you're experiencing issues with newline characters in version 0.10.2, you might want to check if the JSON data is being correctly formatted and escaped before being processed by the HTTP request node.

To continue talking to Dosu, mention @dosu.