shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

[BUG] The host value in the original request header is lost after shenyu forwards it

Open wls981 opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

image image image

As shown in the figure above, the above figure is the list of headers in the web request output in the back-end application after forwarding by shenyu. The value of the host header is not the value of the host header in the original request.

My deployment environment is as follows: image

Expected Behavior

Expect to get the host header value in the original request.

Steps To Reproduce

The deployment environment as described above is reproducible.

Environment

ShenYu version(s):2.4.1

Debug logs

No response

Anything else?

No response

wls981 avatar Mar 17 '22 10:03 wls981

you can used shenyu least version

yu199195 avatar Mar 18 '22 02:03 yu199195

The latest version still has the problem.

wls981 avatar Apr 15 '22 07:04 wls981

shenyu will remove original host in webclient,

headers.remove(HttpHeaders.HOST);

you can used nettyHttpClient

yu199195 avatar Apr 15 '22 08:04 yu199195

image

Yes, I saw that the host header was removed from the webclient plugin. Currently, I modified the plugin and commented out this line, but I don't understand the reason for this.

wls981 avatar Apr 16 '22 04:04 wls981

image

Yes, I saw that the host header was removed from the webclient plugin. Currently, I modified the plugin and commented out this line, but I don't understand the reason for this.

The latest version has been modified. removed:

headers.remove(HttpHeaders.HOST);

hutaishi avatar May 07 '22 04:05 hutaishi