internetarchive / internetarchive/openlibrary
modsec: Can't upload cover art
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 138
Description
### Problem
When I choose a cover from my desktop to upload and hit `Upload`, the dialog just shows a blank rectangle instead of the uploaded picture and the picture is not uploaded. This started happening on Wednesday last week, I think.
[OL62350777M](https://openlibrary.org/books/OL62350777M)
[cover](https://is1-ssl.mzstatic.com/image/thumb/Publication114/v4/d3/1b/57/d31b57a4-4440-38d9-8218-31b7a43e2844/9781974722761.jpg/10000x10000bb.jpg)
### Reproducing the bug
1. Download [this cover](https://is1-ssl.mzstatic.com/image/thumb/Publication114/v4/d3/1b/57/d31b57a4-4440-38d9-8218-31b7a43e2844/9781974722761.jpg/10000x10000bb.jpg) and save it as `Real, Vol. 1.jpg`.
2. Go to edition [OL62350777M](https://openlibrary.org/books/OL62350777M).
3. Hit `Edit`
4. Click `Add Cover Image`.
5. Hit `Browse`.
6. Select the cover.
7. Hit upload.
* Expected behavior:
The cover should be uploaded and then displayed in the dialog.
* Actual behavior:
A blank rectangle is displayed and the cover is not uploaded.
### Context
- Browser (Chrome, Safari, Firefox, etc): Firefox
- OS (Windows, Mac, etc): Linux
- Logged in (Y/N): Y
- Environment (prod, dev, local): prod
### Breakdown
Implementation Details (for maintainers)
#### Requirements Checklist
* [ ]
#### Related files
*
#### Stakeholders
*
#### Instructions for Contributors
- Please [run these commands](https://docs.openlibrary.org/developers/tools/git.html#working-on-your-branch) to ensure your repository is up to date **before** [creating a new branch](https://docs.openlibrary.org/developers/tools/git.html#making-changes-and-creating-a-pull-request) to work on this issue and **each time after** pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
Contributor guide
Research direction
Start by reproducing the issue in Firefox on Linux using edition OL62350777M and the provided cover image, following the seven steps in the report. Trace the Add Cover Image dialog from Edit through Browse and Upload, then verify that the selected image uploads and appears in the dialog instead of a blank rectangle.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100