File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ const HttpTimeout = 30 * time.Second
22
22
23
23
// Dialer control function for validating addresses prior to connection
24
24
func protectedDialerControl (_ , address string , _ syscall.RawConn ) error {
25
-
26
25
err := AddressReferencesPrivateIp (address )
27
26
if err != nil {
28
27
return err
@@ -38,10 +37,14 @@ type ValidatingTransport struct {
38
37
39
38
// RoundTrip validates the request URL prior to forwarding
40
39
func (t * ValidatingTransport ) RoundTrip (req * http.Request ) (* http.Response , error ) {
40
+ // Skip validation if INSECURE_DISABLE_URL_VALIDATION is set
41
+ if strings .EqualFold (os .Getenv ("INSECURE_DISABLE_URL_VALIDATION" ), "true" ) {
42
+ return t .Transport .RoundTrip (req )
43
+ }
44
+
41
45
// Check for valid URL specification
42
46
parsedUrl , err := url .Parse (req .URL .String ())
43
47
if err != nil {
44
- fmt .Print (err )
45
48
return nil , fmt .Errorf ("the supplied URL %s is malformed" , req .URL .String ())
46
49
}
47
50
You can’t perform that action at this time.
0 commit comments