mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
account for mixed case domains (#13342)
Unreleased tweak, do a case insensitive comparison of domains.
This commit is contained in:
parent
e6f3f2e965
commit
2a02936ed6
2 changed files with 18 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue