wix-incubator/wix-http-testkit

Cannot set custom Host header

Closed this issue · 4 comments

When sending a request with an arbitrary Host header - the Host header gets overridden with the value from URL.

Example:

get("http://localhost:12345/somePath", but = withHeaders("Host" -> "somehost.com"))

The request is sent with Host header = localhost:12345 instead of somehost.com

I saw this, without alot of research
akka/akka-http#128
i'll keep this issue open till i have time to figure this out

@genrym I had an issue with overriding Host header in java and it turns out that there are some security fixes maid in JVM to not allow to override this header. Please read this

@mayboroda Not sure whether this is applicable here. wix-http-testkit uses akka for production code. Only if akka internally uses HttpUrlConnection

@genrym agree, I was assuming that this is a JVM related issue. Sorry, I had a wrong assumption.