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

Filter manager fails if given array when expected single term #153

Open
mvar opened this issue Jan 8, 2016 · 0 comments
Open

Filter manager fails if given array when expected single term #153

mvar opened this issue Jan 8, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@mvar
Copy link
Member

mvar commented Jan 8, 2016

I have following configuration:

ongr_filter_manager:
    managers:
        product_list:
            filters:
                - manufacturer
            repository: 'es.manager.default.product'
    filters:
        choice:
            manufacturer: 
                request_field: 'man'
                field: manufacturer

Usually with this config URL looks like this:

/list?man=Swiss+Legend

but if for some reason you pass man as array

/list?man[]=Swiss+Legend

filter manager fails hard. It will return 5xx code "Uncaught PHP Exception" because of "BadRequest400Exception" thrown from Elasticsearch client.

To fail in this case is OK, but we should return HttpException with 4xx error code by ourself.

The real issue here is that we allow filter manager to send invalid query to Elasticsearch. Filter manager should have some kind of validation and make sure that user data does not generate invalid queries.

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

No branches or pull requests

3 participants