Text/xml content type produces file in http tool #8944

Closed
opened 2026-02-21 18:28:46 -05:00 by yindo · 2 comments
Owner

Originally created by @gstrat88 on GitHub (Mar 3, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.0

Cloud or Self Hosted

Cloud

Steps to reproduce

Create an http call receiving a text/xml response. The response should also be less than 1023 to bypass the second check.

✔️ Expected Behavior

The response to be in the body output variable

Actual Behavior

The response is being hold in a file

Originally created by @gstrat88 on GitHub (Mar 3, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.0 ### Cloud or Self Hosted Cloud ### Steps to reproduce Create an http call receiving a text/xml response. The response should also be less than 1023 to bypass the second check. ### ✔️ Expected Behavior The response to be in the body output variable ### ❌ Actual Behavior The response is being hold in a file
yindo added the 🐞 bugcloud labels 2026-02-21 18:28:46 -05:00
yindo closed this issue 2026-02-21 18:28:46 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 3, 2025):

Hey there, @gstrat88! 👋 I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. I'm a bot and can assist you with anything you need.

The issue you're encountering seems to be related to how Dify handles 'text/xml' content type responses. Although I couldn't find specific information on how 'text/xml' responses are processed, the Dify codebase does include logic for handling different content types based on the Content-Disposition header, content characteristics, and MIME type analysis. This logic is detailed in the Response class and its is_file method, which determines if a response should be treated as a file [1].

Additionally, there are configurations in Dify that affect how HTTP responses are processed and stored, such as HTTP_REQUEST_NODE_MAX_BINARY_SIZE and HTTP_REQUEST_NODE_MAX_TEXT_SIZE, which define the maximum sizes for binary and text data in HTTP requests [2].

If the response is being stored as a file despite being under the size limit and having a 'text/xml' content type, it might be due to the logic in the is_file method or related configurations. You may want to review the handling logic in the codebase to ensure it aligns with your expectations for 'text/xml' responses.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 3, 2025): <!-- Greeting --> Hey there, @gstrat88! 👋 I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. I'm a bot and can assist you with anything you need. <!-- Answer --> The issue you're encountering seems to be related to how Dify handles 'text/xml' content type responses. Although I couldn't find specific information on how 'text/xml' responses are processed, the Dify codebase does include logic for handling different content types based on the `Content-Disposition` header, content characteristics, and MIME type analysis. This logic is detailed in the `Response` class and its `is_file` method, which determines if a response should be treated as a file <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/http_request/entities.py)</sup>. Additionally, there are configurations in Dify that affect how HTTP responses are processed and stored, such as `HTTP_REQUEST_NODE_MAX_BINARY_SIZE` and `HTTP_REQUEST_NODE_MAX_TEXT_SIZE`, which define the maximum sizes for binary and text data in HTTP requests <sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup>. If the response is being stored as a file despite being under the size limit and having a 'text/xml' content type, it might be due to the logic in the `is_file` method or related configurations. You may want to review the handling logic in the codebase to ensure it aligns with your expectations for 'text/xml' responses. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/80f6777c-13c0-44ca-85af-05e3daf9cd90?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/80f6777c-13c0-44ca-85af-05e3daf9cd90?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/80f6777c-13c0-44ca-85af-05e3daf9cd90?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/80f6777c-13c0-44ca-85af-05e3daf9cd90?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/80f6777c-13c0-44ca-85af-05e3daf9cd90?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/80f6777c-13c0-44ca-85af-05e3daf9cd90?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/80f6777c-13c0-44ca-85af-05e3daf9cd90?feedback_type=other)</sup>
Author
Owner

@gstrat88 commented on GitHub (Mar 3, 2025):

the problem is indeed here

https://github.com/langgenius/dify/blob/43ab7c22a78f4376275510c7178baf17575cdbe1/api/core/workflow/nodes/http_request/entities.py#L104

so if you change the content-type to application xml it's ok

but the case i describe should be solved from the text marker case and it does not

This was ok before the 1.0 update

@gstrat88 commented on GitHub (Mar 3, 2025): the problem is indeed here https://github.com/langgenius/dify/blob/43ab7c22a78f4376275510c7178baf17575cdbe1/api/core/workflow/nodes/http_request/entities.py#L104 so if you change the content-type to application xml it's ok but the case i describe should be solved from the text marker case and it does not This was ok before the 1.0 update
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8944