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

Ensure inputs are trimmed (spaces, etc.) #84

Closed
fmigneault opened this issue Jul 19, 2018 · 8 comments
Closed

Ensure inputs are trimmed (spaces, etc.) #84

fmigneault opened this issue Jul 19, 2018 · 8 comments
Assignees
Labels
bug Problem, error, or invalid behaviour good first issue Good for newcomers
Milestone

Comments

@fmigneault
Copy link
Collaborator

fmigneault commented Jul 19, 2018

A service on hirondelle was named "ogctb13 " (notice the ending space).
This was causing errors when trying to edit the service via API and UI.

found via unittest run :
http://ci.corpo.crim.ca:8081/view/PAVICS/job/PAVICS_magpie_test_hirondelle/41

Should refuse invalid inputs:

  • spaces
  • slashes (/ \)
  • any other invalid characters that would break RESTful requests
@fmigneault fmigneault added the bug Problem, error, or invalid behaviour label Jul 19, 2018
@fmigneault fmigneault self-assigned this Jul 19, 2018
@dbyrns
Copy link
Contributor

dbyrns commented Jul 19, 2018

+1 for the script!
I think that we can safely remove it... @tomLandry ?

@tomLandry
Copy link

Remove what, the ogctb13 provider? If so, yes. But expect other "ogc_testbed" providers in the future.

@dbyrns
Copy link
Contributor

dbyrns commented Jul 19, 2018

I'm totally fine with new providers from tb14. We will make sure to not add trailing spaces though.

@fmigneault fmigneault mentioned this issue Feb 25, 2019
17 tasks
@fmigneault fmigneault added this to the 0.10.x milestone Mar 28, 2019
@fmigneault fmigneault added the good first issue Good for newcomers label Mar 29, 2019
@fmigneault
Copy link
Collaborator Author

ref #171

@ChaamC
Copy link
Contributor

ChaamC commented Sep 5, 2019

Other errors found :

  • sending an empty input
  • when editing an existing user, sending an info (username, email, ...) that is the same as the existing one ; in this case, it shouldn't produce an error, but accept the input anyway, without any change

@matprov matprov self-assigned this Sep 5, 2019
@fmigneault
Copy link
Collaborator Author

@ChaamC
For the empty input, what is the error?
If it's a bad request, it is behaving as intended. The UI has very limited invalid operation error catching.
Could be added, but it becomes a bigger scope than current issue.

For the update, I believe that at least one change is expected on purpose in the UI, to ensure that an update is actually applied. The API will otherwise raise an error as a bad request (ie: asking something to be updated although nothing has to be updated).

@ChaamC
Copy link
Contributor

ChaamC commented Sep 6, 2019

@fmigneault
I thought we might want to avoid displaying an error on another page (a blank page with some error info). For example, I think when you create a service with the same name as an existing one, it just displays an error message in red on the same page just beside the text box, instead of loading a new error page.
But, we can choose to leave it as it is, since it is still catching the error!

@fmigneault
Copy link
Collaborator Author

@ChaamC
Yes, this is not critical to have it handled nicely in the UI for now. I think the returned error is conflict (409) which the expected behaviour. The blank page with error message is the way the API resolves the content-type (html) that is requested by the UI for the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Problem, error, or invalid behaviour good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants