From bb5466245c53181a3ef46ae207b533c412677b33 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Thu, 30 Jul 2015 13:34:53 -0700 Subject: [PATCH] Add image name tests around hostnames Signed-off-by: Stephen J Day --- registry/api/v2/names_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/registry/api/v2/names_test.go b/registry/api/v2/names_test.go index 89ab9c619..656ae8466 100644 --- a/registry/api/v2/names_test.go +++ b/registry/api/v2/names_test.go @@ -164,6 +164,23 @@ var ( err: ErrRepositoryNameComponentInvalid, invalid: true, }, + { + input: "b.gcr.io/test.example.com/my-app", // embedded domain component + }, + // TODO(stevvooe): The following is a punycode domain name that we may + // want to allow in the future. Currently, this is not allowed but we + // may want to change this in the future. Adding this here as invalid + // for the time being. + { + input: "xn--n3h.com/myimage", // http://☃.com in punycode + err: ErrRepositoryNameComponentInvalid, + invalid: true, + }, + { + input: "xn--7o8h.com/myimage", // http://🐳.com in punycode + err: ErrRepositoryNameComponentInvalid, + invalid: true, + }, } )