Skip to content

Commit

Permalink
Shorten the receiver name
Browse files Browse the repository at this point in the history
  • Loading branch information
sakurai-youhei committed Oct 28, 2023
1 parent a085274 commit a841f3d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions libbeat/esleg/eslegclient/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,14 @@ func (conn *Connection) Close() error {
type httpClientProxySettings httpcommon.HTTPClientProxySettings

// ProxyDialer is a dialer that can be registered to golang.org/x/net/proxy
func (settings *httpClientProxySettings) ProxyDialer(_ *url.URL, forward proxy.Dialer) (proxy.Dialer, error) {
func (h *httpClientProxySettings) ProxyDialer(_ *url.URL, forward proxy.Dialer) (proxy.Dialer, error) {
return transport.DialerFunc(func(_, address string) (net.Conn, error) {

// Headers given to the CONNECT request
hdr := settings.Headers.Headers()
if settings.URL.User != nil {
username := settings.URL.User.Username()
password, _ := settings.URL.User.Password()
hdr := h.Headers.Headers()
if h.URL.User != nil {
username := h.URL.User.Username()
password, _ := h.URL.User.Password()
if len(hdr) == 0 {
hdr = http.Header{}
}
Expand All @@ -339,7 +339,7 @@ func (settings *httpClientProxySettings) ProxyDialer(_ *url.URL, forward proxy.D
}

// Dial the proxy host
c, err := forward.Dial("tcp", settings.URL.Host)
c, err := forward.Dial("tcp", h.URL.Host)
if err != nil {
return nil, err
}
Expand All @@ -350,7 +350,6 @@ func (settings *httpClientProxySettings) ProxyDialer(_ *url.URL, forward proxy.D
return nil, err
}


res, err := http.ReadResponse(bufio.NewReader(c), req)
if err != nil {
c.Close()
Expand Down

0 comments on commit a841f3d

Please sign in to comment.