v5.0.67: fix proxy nil crash + net/url import
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -137,7 +138,7 @@ func (p *NubesProvider) Configure(ctx context.Context, req provider.ConfigureReq
|
||||
proxyFunc := transport.Proxy
|
||||
target := addr
|
||||
if proxyFunc != nil {
|
||||
proxy, err := proxyFunc(nil)
|
||||
proxy, err := proxyFunc(&http.Request{URL: &url.URL{Scheme: "https", Host: target}})
|
||||
if err == nil && proxy != nil {
|
||||
conn, err := dialer.DialContext(ctx, "tcp", proxy.Host)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user