Skip to content

Wrong status code returned for sketch/file that does not exist #1264

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

Closed
thegitone23 opened this issue Feb 17, 2020 · 2 comments · Fixed by #1265
Closed

Wrong status code returned for sketch/file that does not exist #1264

thegitone23 opened this issue Feb 17, 2020 · 2 comments · Fixed by #1265

Comments

@thegitone23
Copy link
Contributor

thegitone23 commented Feb 17, 2020

Nature of issue?

  • Found a bug

Details about the bug:

  • Web browser and version: Firefox
  • Operating System: Linux
  • Steps to reproduce this bug:
    Go to https://editor.p5js.org/sketches/any_id/assets/any_file and 502 is returned.
    The problem is caused by the fact that the function getFileContent which is supposed to handle this route isn't verifying whether the returned object from database is null or not and it's also not checking for undefined asset name.

Because the sketch/file does not exist, a 404 error should be returned.

@welcome
Copy link

welcome bot commented Feb 17, 2020

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

@thegitone23
Copy link
Contributor Author

thegitone23 commented Feb 17, 2020

I am doing a pr to fix this issue
#1265

@thegitone23 thegitone23 changed the title Method getFileContent doesn't handle invalid project id Method handeling route to get assets corresponding to a project isn't handeling invalid project id or empty asset parameter Feb 18, 2020
@catarak catarak changed the title Method handeling route to get assets corresponding to a project isn't handeling invalid project id or empty asset parameter Wrong status code returned for sketch/file that does not exist Mar 30, 2020
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.

1 participant