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

CIDR search: Show hint if not in CIDR format #52

Open
bernhardreiter opened this issue Apr 27, 2017 · 1 comment
Open

CIDR search: Show hint if not in CIDR format #52

bernhardreiter opened this issue Apr 27, 2017 · 1 comment

Comments

@bernhardreiter
Copy link
Member

Use case:
A users wants to get a hint if the network she typed into the search field has an obvious typo regarding the CIDR format to be able to correct the search.

Examples:

  • 194.94.208..5/16
  • 2001:638:::0/24

technical side

What happens in current fody v0.4.3-dev is that the frontend estimates if we have a cidr (by estimating country-code and domain name first) and then sends the request to the backend. The backend uses the postgresql query and postgresql will do the typecast to the cidr type and throw a DataError if this fails. This error is already transfert to the client (https code 400) returning the json string {"reason": "DataError, probably not in cidr style."}.

Because the real test happens in the database backend, a client side test always has the danger of not being identical to the postgresql check. So it seems to be a good solution to bring the backend error code up to the front and make it visible. However it would make sense to also have a client side check that works while the user is typing.

@bernhardreiter
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant