feat: add reusable proxy configuration
This commit is contained in:
@@ -63,3 +63,20 @@ func TestLaunchSpecNormalizeRejectsInvalidRemoteDebugPort(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeProxyServerCanonicalizesAndRejectsCredentials(t *testing.T) {
|
||||
got, err := NormalizeProxyServer(" HTTPS://Proxy.Local:8443 ")
|
||||
if err != nil || got != "https://proxy.local:8443" {
|
||||
t.Fatalf("NormalizeProxyServer() = %q, %v", got, err)
|
||||
}
|
||||
for _, value := range []string{
|
||||
"http://user:secret@127.0.0.1:8080",
|
||||
"http://127.0.0.1:8080/path",
|
||||
"ftp://127.0.0.1:21",
|
||||
"socks5://127.0.0.1:70000",
|
||||
} {
|
||||
if _, err := NormalizeProxyServer(value); !errors.Is(err, ErrInvalidLaunchSpec) {
|
||||
t.Errorf("NormalizeProxyServer(%q) error = %v", value, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user