account for mixed case domains (#13342)

Unreleased tweak, do a case insensitive comparison of domains.
This commit is contained in:
Roberto Dip 2023-08-15 19:11:44 -03:00 committed by GitHub
parent e6f3f2e965
commit 2a02936ed6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View file

@ -171,7 +171,7 @@ func CheckAssignedEnrollmentProfile(expectedURL string) error {
return fmt.Errorf("parsing profiles output: unable to parse configuration web url: %w", err)
}
if assigned.Hostname() != expected.Hostname() {
if !strings.EqualFold(assigned.Hostname(), expected.Hostname()) {
return fmt.Errorf(`matching configuration web url: expected '%s' but found '%s'`, expected.Hostname(), assigned.Hostname())
}

View file

@ -102,7 +102,7 @@ MDM server / https://test.example.com
`),
nil,
true,
"",
"//test.example.com",
false,
},
{
@ -200,6 +200,22 @@ func TestCheckAssignedEnrollmentProfile(t *testing.T) {
ConfigurationURL = "https://test.example.com/mdm/apple/enroll?token=1234";
ConfigurationWebURL = "https://valid.com?token=1234";
...
}
`),
nil,
false,
nil,
},
{
"mixed case match",
ptr.String(`Device Enrollment configuration:
{
AllowPairing = 1;
AutoAdvanceSetup = 0;
AwaitDeviceConfigured = 0;
ConfigurationURL = "https://test.ExaMplE.com/mdm/apple/enroll?token=1234";
ConfigurationWebURL = "https://vaLiD.com?tOken=1234";
...
}
`),
nil,