Inconsistent client-side and server-side validation for URL metadata fields #4306
Closed
1 of 4 tasks
Labels
bug
Something isn't working
How are you running Flagsmith
Describe the bug
URL metadata fields are validated serverside to have a scheme and authority per
flagsmith/api/metadata/models.py
Line 60 in 1dfcdc2
However, client-side a scheme is not mandated, and an error is not shown in this case.
Steps To Reproduce
https://example.com
example.com
Changes are not saved because the API rejects a URL without a scheme like
example.com
as invalid, but the UI doesn't mark the same value as invalid. Other invalid values likeexample
are correctly rejected by both API and UI.Expected behavior
Validation for URLs should behave the same way in the UI and API. I would prefer keeping the API's validation logic to always make URL schemes explicit in whatever custom field data we're storing.
Screenshots
No response
The text was updated successfully, but these errors were encountered: