We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3444820 + eba561b commit 8ced7a5Copy full SHA for 8ced7a5
1 file changed
internal/util/header_helpers.go
@@ -47,6 +47,14 @@ func applyCustomHeaders(r *http.Request, headers map[string]string) {
47
if k == "" || v == "" {
48
continue
49
}
50
+ // net/http reads Host from req.Host (not req.Header) when writing
51
+ // a real request, so we must mirror it there. Some callers pass
52
+ // synthetic requests (e.g. &http.Request{Header: ...}) and only
53
+ // consume r.Header afterwards, so keep the value in the header
54
+ // map too.
55
+ if http.CanonicalHeaderKey(k) == "Host" {
56
+ r.Host = v
57
+ }
58
r.Header.Set(k, v)
59
60
0 commit comments