Closed nardev closed 4 years ago
Hi, you can use html5 validators in your html/js code. I think that validating form input at the server side of web application is depreceated - in case of wrong input there is big overhead to bring everything back to the client and highlight errors IMHO.
Well, if you don't have web interface but a rest API? Or if you decide to send json formated config file with a lot of data via POST?
On Tue, Feb 11, 2020, 6:14 AM Pablo2048 notifications@github.com wrote:
Hi, you can use html5 validators in your html/js code. I think that validating form input at the server side of web application is depreceated
- in case of wrong input there is big overhead to bring everything back to the client and highlight errors IMHO.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/me-no-dev/ESPAsyncWebServer/issues/701?email_source=notifications&email_token=AAFJ55TDJKRMY2HWK4GL4C3RCIX4NA5CNFSM4KSZI262YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELLHSAA#issuecomment-584481024, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFJ55X3ORN4IRNCJLHLGW3RCIX4NANCNFSM4KSZI26Q .
If you do so this way, you have to write separate library for doing this. It has nothing to do with the ESPAsyncWebServer library. Also this is not "Form validation" neither...
Well, you are right of course. But where else can i initiate such conversation? Isn't this the perfect place :)
:-) I suggest to try esp8266.com , or reddit, or... I did an quick search for "parameter validation library c++" and found this https://www.learncpp.com/cpp-tutorial/185-stream-states-and-input-validation/ so it seems like regex implementation is the best way to do it :D
mmm i think that you didn't understand my point... sorry
Oh, so sorry...
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
As there is more and more http rest style of communication, it's pretty logical to have a class for basic validations in C++.
I tried to find something, but no luck so far. It's ok to implement it from time to time, copy/paste some functions but it would be much better maintained and probably safer if there was an opensource class, openly maintained, where bugs could be tracked and fixed.
Did i miss something like that already?
For example, i would like to be to easily validate:
and, maybe someone else have more ideas.
Any thoughts?