dify icon indicating copy to clipboard operation
dify copied to clipboard

workflow node http-request header cover

Open opsvr202 opened this issue 1 year ago • 1 comments

Self Checks

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

Dify version

0.15.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The reproduction steps are as follows:

  1. Add an HTTP request node in workflow;
  2. Configure the post request, where the Headers add the key Host and the value is customized;
  3. Execute the http request node;
  4. When grabbing the headers from the interface server, it was found that the Host in the original request headers had been replaced; As shown in the following figure

Image

Image

Image

Due to the replacement of the Headers content, some interfaces may require specifying the Host when making requests, which can lead to exceptions

✔️ Expected Behavior

The Headers of the HTTP request node in workflow retains the original information and sends it to the server

❌ Actual Behavior

Now, in the dify version of workflow, the HTTP request node will replace the Headers content when sending requests

opsvr202 avatar Jan 18 '25 11:01 opsvr202

The issue you're experiencing with the HTTP request node in Dify replacing the 'Host' header is likely due to how headers are managed in the code. The 'Host' header is set in the to_log method for logging purposes, but this does not affect the actual request sent [1]. However, there might be other parts of the system or network configuration that could be altering the 'Host' header during request execution.

To address this, you might want to check if there are any middleware or network configurations in your environment that could be modifying the 'Host' header. Additionally, reviewing the _assembling_headers method in the Executor class could provide insights into how headers are being set or modified before the request is sent [1]. If the issue persists, consider looking into any custom configurations or proxies that might be affecting the request headers.

To continue talking to Dosu, mention @dosu.


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

dosubot[bot] avatar Jan 18 '25 12:01 dosubot[bot]