You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using hoverfly-java (0.14.0) with my Spring project in integration testing.
My actual service (under test/spy) calls are routed through envoy which relies on the Host: X header - where X specifies the service name.
For example, this is the original request:
I went through some debugging and couldn't see anywhere in goproxy or hoverfly that would remove the Host header, and then I found this in the golang HTTP doc:
// For incoming requests, the Host header is promoted to the
// Request.Host field and removed from the Header map.
It's surprising to see that's how the go HTTP package behaves. As hoverfly doesn't see the original Host header, it cannot reconstruct the original request with the Host header value you supply.
You can read more about the original Go issue on Github: golang/go#7682
A workaround is probably to use a custom host header for routing, however I'm not sure if your envoy proxy supports it.
Activity
tommysitu commentedon Jun 7, 2022
I went through some debugging and couldn't see anywhere in goproxy or hoverfly that would remove the
Hostheader, and then I found this in the golang HTTP doc:It's surprising to see that's how the go HTTP package behaves. As hoverfly doesn't see the original Host header, it cannot reconstruct the original request with the Host header value you supply.
You can read more about the original Go issue on Github: golang/go#7682
A workaround is probably to use a custom host header for routing, however I'm not sure if your envoy proxy supports it.