Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent client-side and server-side validation for URL metadata fields #4306

Closed
1 of 4 tasks
rolodato opened this issue Jul 8, 2024 · 0 comments · Fixed by #4327
Closed
1 of 4 tasks

Inconsistent client-side and server-side validation for URL metadata fields #4306

rolodato opened this issue Jul 8, 2024 · 0 comments · Fixed by #4327
Assignees
Labels
bug Something isn't working

Comments

@rolodato
Copy link
Member

rolodato commented Jul 8, 2024

How are you running Flagsmith

  • Self Hosted with Docker
  • Self Hosted with Kubernetes
  • SaaS at flagsmith.com
  • Some other way (add details in description below)

Describe the bug

URL metadata fields are validated serverside to have a scheme and authority per

return all([result.scheme, result.netloc])

However, client-side a scheme is not mandated, and an error is not shown in this case.

Steps To Reproduce

  1. Save a URL metadata field with a valid value like https://example.com
  2. Try to update the value to 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 like example 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

@rolodato rolodato added the bug Something isn't working label Jul 8, 2024
@novakzaballa novakzaballa linked a pull request Jul 11, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants