Fix nil pointer dereference segfault when passing "null" config json to cloudflared tunnel ingress validate (#1070)

This commit is contained in:
Sam Cook
2023-12-15 05:29:40 +13:00
committed by GitHub
parent a4a84bb27e
commit f2c4fdb0ae
2 changed files with 6 additions and 1 deletions

View File

@@ -43,6 +43,11 @@ ingress:
require.Equal(t, "https", s.scheme)
}
func TestParseIngressNilConfig(t *testing.T) {
_, err := ParseIngress(nil)
require.Error(t, err)
}
func TestParseIngress(t *testing.T) {
localhost8000 := MustParseURL(t, "https://localhost:8000")
localhost8001 := MustParseURL(t, "https://localhost:8001")