Skip to content

Commit

Permalink
Fix globocom#6: allow use of Host header
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoyeds authored Oct 5, 2021
1 parent a9548c3 commit d739f00
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion goreq.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,11 @@ func (r Request) NewRequest() (*http.Request, error) {
return nil, err
}
// add headers to the request
req.Host = r.Host
if host := req.Header.Get("Host"); host != "" {
req.Host = host
} else {
req.Host = r.Host
}

r.addHeaders(req.Header)
if r.Compression != nil {
Expand Down

0 comments on commit d739f00

Please sign in to comment.