|
@@ -328,10 +328,19 @@ func TestIsSecure(t *testing.T) {
|
|
|
}{
|
|
|
{"example.com", []string{}, true},
|
|
|
{"example.com", []string{"example.com"}, false},
|
|
|
- {"localhost", []string{"localhost:5000"}, true},
|
|
|
+ {"localhost", []string{"localhost:5000"}, false},
|
|
|
{"localhost:5000", []string{"localhost:5000"}, false},
|
|
|
- {"localhost", []string{"example.com"}, true},
|
|
|
+ {"localhost", []string{"example.com"}, false},
|
|
|
{"127.0.0.1:5000", []string{"127.0.0.1:5000"}, false},
|
|
|
+ {"localhost", []string{}, false},
|
|
|
+ {"localhost:5000", []string{}, false},
|
|
|
+ {"127.0.0.1", []string{}, false},
|
|
|
+ {"localhost", []string{"example.com"}, false},
|
|
|
+ {"127.0.0.1", []string{"example.com"}, false},
|
|
|
+ {"example.com", []string{}, true},
|
|
|
+ {"example.com", []string{"example.com"}, false},
|
|
|
+ {"127.0.0.1", []string{"example.com"}, false},
|
|
|
+ {"127.0.0.1:5000", []string{"example.com"}, false},
|
|
|
}
|
|
|
for _, tt := range tests {
|
|
|
if sec := IsSecure(tt.addr, tt.insecureRegistries); sec != tt.expected {
|