Allow uppercase characters in hostnames
This allows hostnames to contain uppercase characters, matching behavior in Docker versions before 1.10. It does not attempt to canonicalize hostnames into a lowercase format before parsing, since this could lead to corner cases (for example, making Hostname.Domain.Com/ref ambiguous on a daemon which contains references for both hostname.domain.com/ref and Hostname.Domain.Com/ref). Fixes: #1433 Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
parent
5e4ea38a2f
commit
950d34d210
3 changed files with 14 additions and 2 deletions
|
@ -111,6 +111,10 @@ func TestHostRegexp(t *testing.T) {
|
|||
input: "xn--n3h.com", // ☃.com in punycode
|
||||
match: true,
|
||||
},
|
||||
{
|
||||
input: "Asdf.com", // uppercase character
|
||||
match: true,
|
||||
},
|
||||
}
|
||||
r := regexp.MustCompile(`^` + hostnameRegexp.String() + `$`)
|
||||
for i := range hostcases {
|
||||
|
@ -399,6 +403,14 @@ func TestFullNameRegexp(t *testing.T) {
|
|||
match: true,
|
||||
subs: []string{"registry.io", "foo/project--id.module--name.ver---sion--name"},
|
||||
},
|
||||
{
|
||||
input: "Asdf.com/foo/bar", // uppercase character in hostname
|
||||
match: true,
|
||||
},
|
||||
{
|
||||
input: "Foo/FarB", // uppercase characters in remote name
|
||||
match: false,
|
||||
},
|
||||
}
|
||||
for i := range testcases {
|
||||
checkRegexp(t, anchoredNameRegexp, testcases[i])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue