fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
2.24k stars 360 forks source link

Require URL contains valid protocol in MDM settings end user migration form #19124

Closed gillespi314 closed 1 week ago

gillespi314 commented 2 weeks ago

Issue #18566

gillespi314 commented 2 weeks ago

@RachelElysia, I think the issue found by QAWolf may stem from the changes made to frontend URL validation in this PR. The options for the new validator library are a bit confusing, but looking into the source, it seems that require_protocol must be set in order to check that a protocol is actually present. The protocols and require_valid_protocol only test validity of the protocol prefix if one is detected. Otherwise it considers "example.com" to be ok.

I haven't checked whether the issue might also be present on other pages. In the interest of time, I just imported the new validator library directly on this page so that I could set the additional options required for the validator to check for the presence of a protocol.

Since you are more familiar with the changes more generally, would you mind taking a look at the usage in other places to confirm it works as expected?