Android: a media delete failure other than IOException loses its CORS headers
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
Research direction
Read MediaUploadServer.handleDelete and compare its exception handling with passthroughResponse and processAndRespond. Ensure non-cancellation exceptions receive the server response with CORS headers while CancellationException is rethrown; verify the delete failure no longer becomes a CORS-less fallback 500.
Written by the indexing model from the issue text.
Description
On Android, a media delete that fails with anything other than an IOException gets a response without CORS headers. The editor then can't read it, and reports a generic network error instead of the real cause.
Follow-up from #594. Found by reading the code; not reproduced.
What happens
MediaUploadServer.handleDelete catches only IOException. The upload paths (passthroughResponse, processAndRespond) catch every Exception, so that a failure is still answered by the server with CORS headers.
Any other exception from the delete escapes to HttpServer's fallback 500, which carries no CORS headers. The web view rejects that response, and the page sees fetch_error ("Could not get a valid response from the server.").
Building the OkHttp request is one place this could happen: addHeader throws IllegalArgumentException for a header value containing a character it doesn't allow, such as a newline. MediaServerCredentials.areUsable only checks that the auth header isn't empty.
Who is affected
Android hosts whose loopback upload server is running (a mediaProcessor or mediaUploader is set). The main sender is core's orphan cleanup after an upload's post-process retries all fail. The cleanup fails either way; only the error the editor logs is wrong.
Suggested fix
Catch Exception in handleDelete, rethrowing CancellationException, as passthroughResponse does.
- Dominant language
- JavaScript
- Stars
- 29
- Forks
- 7
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 75
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wordpress-mobile/GutenbergKit
-
[Type] Bug iOS
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
wordpress-mobile/GutenbergKit#846 ·
Maintainers usually reply within 1 day
-
[Type] Bug [Type] Code Quality iOS
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
wordpress-mobile/GutenbergKit#668 ·
Maintainers usually reply within 1 day
-
[Type] Bug [Type] Performance iOS
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
wordpress-mobile/GutenbergKit#666 ·
Maintainers usually reply within 1 day
-
[Type] Bug iOS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wordpress-mobile/GutenbergKit#664 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wordpress-mobile/GutenbergKit#522 ·
Maintainers usually reply within 1 day
All issues in wordpress-mobile/GutenbergKit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
mailgun/mailgun.js#544 ·
-
beginner bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
BistaDinesh03/critique#266 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
solana-foundation/solana-web3.js#4015 · 1 comment ·
Maintainers usually reply within 1 day
-
area: dependencies auto-generated cwe: 405 dependencies ecosystem: npm help wanted package: minimatch scope: runtime security security-alert severity: medium source: dependabot supply-chain vulnerability
Difficulty 2/5 Half a day Newbie friendliness 65/100
tdk-landscape/tdk-cli-core#2811 ·
-
a11y bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-webui/open-webui#33442 · 2 comments ·
Maintainers usually reply within 1 day