diff --git a/registry/storage/schema2manifesthandler.go b/registry/storage/schema2manifesthandler.go index 6456efa4..fc7cc6eb 100644 --- a/registry/storage/schema2manifesthandler.go +++ b/registry/storage/schema2manifesthandler.go @@ -107,6 +107,7 @@ func (ms *schema2ManifestHandler) verifyManifest(ctx context.Context, mnfst sche pu, err = url.Parse(u) if err != nil || (pu.Scheme != "http" && pu.Scheme != "https") || pu.Fragment != "" { err = errInvalidURL + break } } } diff --git a/registry/storage/schema2manifesthandler_test.go b/registry/storage/schema2manifesthandler_test.go index c2f61edf..766b4535 100644 --- a/registry/storage/schema2manifesthandler_test.go +++ b/registry/storage/schema2manifesthandler_test.go @@ -78,6 +78,11 @@ func TestVerifyManifestForeignLayer(t *testing.T) { []string{"https://foo/bar", ""}, errInvalidURL, }, + { + foreignLayer, + []string{"", "https://foo/bar"}, + errInvalidURL, + }, { foreignLayer, []string{"http://foo/bar"},