Skip to content

Commit

Permalink
set *http.Request's Host if Host header has been set
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Jun 6, 2017
1 parent 0b300ac commit e6d3257
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions req.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ func (r *Req) Do(method, rawurl string, vs ...interface{}) (resp *Resp, err erro
}
req.URL = u

if host := req.Header.Get("Host"); host != "" {
req.Host = host
}

for _, fn := range delayedFunc {
fn()
}
Expand Down

0 comments on commit e6d3257

Please sign in to comment.