account for mixed case domains (#13342)
Unreleased tweak, do a case insensitive comparison of domains.
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user