glide
glide copied to clipboard
Add 400 Bad Request when using bad value or unknown parameters with Server::getImageResponse
Hello,
What about validating provided parameters and answer a 400 Bad Response http code when.
For example when calling:
$server->getImageResponse($path, ['unvalid' => 'value']);
It would return a http response with 400 status code which explain what is wrong.
I do think it would improve DX and UX.
What do you think?
I think 400 responses make sense when expected parameters are incorrect, e.g. ?w=johnny
. I'm hesitant to 400 with unsupported values: w=100&h=100&tracker=15123
. There are too many options for what applications may be adding for their own purposes.
I would be interested if it's something you could turn on and off, on in production off in development to catch potential issues.
I do agree for unknown parameters :+1:
Turning on and off could be a bad idea in the sense of it could hide some unwanted mistakes.