Skip to content

Commit

Permalink
chore: use strings.ContainsRune instead
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored and elazarl committed Oct 17, 2023
1 parent 2592e75 commit 1fe6677
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions https.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func (proxy *ProxyHttpServer) NewConnectDialToProxyWithHandler(https_proxy strin
return nil
}
if u.Scheme == "" || u.Scheme == "http" {
if strings.IndexRune(u.Host, ':') == -1 {
if !strings.ContainsRune(u.Host, ':') {
u.Host += ":80"
}
return func(network, addr string) (net.Conn, error) {
Expand Down Expand Up @@ -418,7 +418,7 @@ func (proxy *ProxyHttpServer) NewConnectDialToProxyWithHandler(https_proxy strin
}
}
if u.Scheme == "https" || u.Scheme == "wss" {
if strings.IndexRune(u.Host, ':') == -1 {
if !strings.ContainsRune(u.Host, ':') {
u.Host += ":443"
}
return func(network, addr string) (net.Conn, error) {
Expand Down

0 comments on commit 1fe6677

Please sign in to comment.