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

API hangs when filter contains variable starting with $ #581

Closed
ohmoses opened this issue Aug 16, 2019 · 1 comment · Fixed by #585
Closed

API hangs when filter contains variable starting with $ #581

ohmoses opened this issue Aug 16, 2019 · 1 comment · Fixed by #585

Comments

@ohmoses
Copy link

ohmoses commented Aug 16, 2019

When I send a request with a filter containing a variable that starts with a $, e.g. GET /cloud/articles/?filter={"$selected":true}, API probably passes is onto Mongo as a selection operator and the request hangs.

Expected behavior

If a field with that name doesn't exist and it's not a valid Mongo operator either, API should return the appropriate 4xx code (?) To be discussed (e.g. do we allow field names starting with $?)

@eduardoboucas
Copy link
Contributor

This was an issue caused by the MongoDB connector not propagating an error. It has been fixed in dadi/api-mongodb#67 and released as version 5.0.3 of @dadi/api-mongodb.

Additionally, #585 adds the correct status code and error message for this case.

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

Successfully merging a pull request may close this issue.

2 participants