Open cbastienbaron opened 10 months ago
Hi @cbastienbaron!
In fact, because of the monsieurbiz_search_post
route, you can POST an empty value and this causes a 500 error.
Instead of the PR #202, I suggest generating a 404 in the postAction
method if $query
is empty.
For information, is it possible to reproduce this error with our test app : curl -I -XPOST https://localhost:8000/en_US/search
Hey @delyriand :vulcan_salute:
yup the goal is to avoid a 500 (empty search or 404 is fine to me :+1: )
@cbastienbaron,
I pushed a new commit on your PR to throw a 404
Hi ,
Facing an issue when a user post an empty search or try to discover some 500 on app
To reproduce
https://github.com/monsieurbiz/SyliusSearchPlugin/blob/master/src/Controller/SearchController.php#L102
if query param no exist, an empty string is assigned
$query
but routemonsieurbiz_search_search
required 1 char minimum https://github.com/monsieurbiz/SyliusSearchPlugin/blob/master/src/Resources/config/routing/shop.yaml#L7a possible solution will be to authorize 0 to n char