logoalt Hacker News

mrheosuper • today at 3:54 AM • 1 reply • view on HN

The question can be reduce to "who do the length validation".

In my case, if i write a public-facing API, i never trust the caller will do the correct thing, thus the caller must provide all the critical parameters, and i must validate all of them.


Replies

userbinator • today at 4:50 AM

The question can be reduce to "who do the length validation".

At the boundary where untrusted input becomes trusted. This is commonly known as the sanitisation/validation layer.