registry: add tests for unresolvable domain names in isSecure
Signed-off-by: Tibor Vass <teabee89@gmail.com>
This commit is contained in:
parent
b11b1e06e9
commit
807bb5eb18
1 changed files with 3 additions and 0 deletions
|
@ -348,6 +348,9 @@ func TestIsSecure(t *testing.T) {
|
||||||
{"example.com:5000", []string{"42.42.42.42/8"}, false},
|
{"example.com:5000", []string{"42.42.42.42/8"}, false},
|
||||||
{"127.0.0.1:5000", []string{"127.0.0.0/8"}, false},
|
{"127.0.0.1:5000", []string{"127.0.0.0/8"}, false},
|
||||||
{"42.42.42.42:5000", []string{"42.1.1.1/8"}, false},
|
{"42.42.42.42:5000", []string{"42.1.1.1/8"}, false},
|
||||||
|
{"invalid.domain.com", []string{"42.42.0.0/16"}, true},
|
||||||
|
{"invalid.domain.com", []string{"invalid.domain.com"}, false},
|
||||||
|
{"invalid.domain.com:5000", []string{"invalid.domain.com"}, false},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
// TODO: remove this once we remove localhost insecure by default
|
// TODO: remove this once we remove localhost insecure by default
|
||||||
|
|
Loading…
Reference in a new issue