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

413 Request Entity Too Large on import - no UI warning + possible to bypass #2340

Closed
msub2 opened this issue Nov 10, 2022 · 2 comments · Fixed by #3121
Closed

413 Request Entity Too Large on import - no UI warning + possible to bypass #2340

msub2 opened this issue Nov 10, 2022 · 2 comments · Fixed by #3121
Labels
bug Something isn't working

Comments

@msub2
Copy link

msub2 commented Nov 10, 2022

Describe the bug
A user recently reported to me that they received a 413 - Request Entity Too Large error when attempting to import a file larger than 2MB. While I don't have the exact file they used, I was able to replicate the behavior by attempting to upload a shortcut file that pointed to a larger exe. This was not caught by the size checker. Additionally, when directly choosing a file over the size limit there is no visual indicator other than the import button being disabled, although I can see in code that there is supposed to be.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://books.theunseen.city/import
  2. Click on Browse
  3. Select a file over 2 MB large.
  4. See that there is no visual feedback other than the disabled import button.

OR

  1. Select a shortcut to a file over 2 MB large.
  2. Receive a 413 error on submit

Expected behavior
User should be shown clear feedback that the file they have selected is too large.

Screenshots
If applicable, add screenshots to help explain your problem.

Instance
https://books.theunseen.city/

Additional context
The primary issue for the user here is moreso that they need a higher file size limit to import their data, the lack of warnings is essentially a secondary issue I noticed when checking myself.


Desktop (please complete the following information):
- OS: Windows 10
- Browser: Firefox
- Version: 106

@msub2 msub2 added the bug Something isn't working label Nov 10, 2022
@msub2
Copy link
Author

msub2 commented Nov 10, 2022

The bypass issue could probably be solved just by restricting the filepicker to .csv files, since those are the only kinds listed as being valid for import.

@mouse-reeve
Copy link
Member

TSV is also a valid format, but you're right that it ought to check

hughrun added a commit to hughrun/bookwyrm that referenced this issue Nov 18, 2023
When a RequestDataTooBig exception is thrown, users are largely in the dark about what happened and how it can be fixed.
This commit resolves this by inserting middleware to redirect the request to a custom 413 error page.

This exception is thrown when DATA_UPLOAD_MAX_MEMORY_SIZE is exceeded. The default value is 2.5MB.

Fixes bookwyrm-social#2340
Fixes bookwyrm-social#2633
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants