Skip to content

Commit

Permalink
fix http dialer header
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu committed Oct 31, 2024
1 parent ec6b7f8 commit 97268d7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions client_dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,11 @@ func (d *HTTPDialer) DialContext(ctx context.Context, network, addr string) (net
c := httpconnpool.Get().(*httpConn)
c.dialer = d
c.ctx = ctx
c.req.URL = d.Endpoint
c.req.Host = d.Endpoint.Host
c.req.Header = d.Header
if c.req.Header == nil {
if d.Header != nil {
c.req.Header = d.Header
} else {
c.req.Header = httpconnheader
}
c.req.URL = d.Endpoint
c.req.Host = d.Endpoint.Host
c.req.Header = httpconnheader
}
c.writer.B = c.writer.B[:0]
c.reader.B = nil
Expand Down

0 comments on commit 97268d7

Please sign in to comment.