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

Data reports api doesn't throw error on bad parameter #80

Open
tomasholderness opened this issue Feb 9, 2018 · 4 comments
Open

Data reports api doesn't throw error on bad parameter #80

tomasholderness opened this issue Feb 9, 2018 · 4 comments
Assignees
Labels

Comments

@tomasholderness
Copy link
Contributor

e.g. ?time_window= still returns reports which it should be ?timewindow= as per docs.petabencana.id.

=> Check Joi validation settings on reports endpoint.

@tomasholderness tomasholderness self-assigned this Feb 9, 2018
@tomasholderness
Copy link
Contributor Author

tomasholderness commented Mar 12, 2018

N.b. this only happens in AWS environments; Joi validation is doing its thing but doesn't seem to be returned to user.

@tomasholderness
Copy link
Contributor Author

tomasholderness commented Mar 12, 2018

More specifically this happens on API GW routes where we're using an 'Integration Request' instead of a 'HTTP_Proxy' method type.

ping @matthewberryman

@tomasholderness
Copy link
Contributor Author

Also, passing a bad value to a valid parameter returns what should be a 400 error (as returned by Joi) as a 200.

For example: https://data-dev.riskmap.us/reports?city=2

@matthewberryman
Copy link
Contributor

matthewberryman commented Mar 27, 2018

You just need to swap these to http proxy (under integration):

  • Tick box "Use HTTP Proxy integration" under Integration Request and confirm,
  • Under Method Request remove any query parameters, request headers, request body and disable any request validation (since all of this is done in cognicity-server).
  • Deploy changes to the stage.
  • Just double check that caching is off under stage settings.

I've done this and tested and confirmed as working for GET /reports on data-dev.petabencana.id , e.g. https://data-dev.petabencana.id/reports?spam=123 ,
(but not the sub-paths under it) - sing out if you need further help.

@matthewberryman matthewberryman self-assigned this Mar 27, 2018
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

2 participants