Android: a media delete failure other than IOException loses its CORS headers
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读 MediaUploadServer.handleDelete,并将其异常处理与 passthroughResponse 和 processAndRespond 进行比较。确保非取消异常会收到带有 CORS 标头的服务器响应,而 CancellationException 会被重新抛出;验证删除失败不再变成不带 CORS 的备用 500 响应。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- JavaScript
- 星标
- 29
- 派生
- 7
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 70
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
wordpress-mobile/GutenbergKit 的其他 Issue
-
[Type] Bug iOS
难度 2/5 1-3 小时 新手友好度 77/100
wordpress-mobile/GutenbergKit#846 ·
维护者通常 1 天内回复
-
[Type] Bug [Type] Code Quality iOS
难度 2/5 1-3 小时 新手友好度 88/100
wordpress-mobile/GutenbergKit#668 ·
维护者通常 1 天内回复
-
[Type] Bug [Type] Performance iOS
难度 2/5 1-3 小时 新手友好度 88/100
wordpress-mobile/GutenbergKit#666 ·
维护者通常 1 天内回复
-
[Type] Bug iOS
难度 2/5 1-3 小时 新手友好度 78/100
wordpress-mobile/GutenbergKit#664 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
wordpress-mobile/GutenbergKit#522 ·
维护者通常 1 天内回复
查看 wordpress-mobile/GutenbergKit 的全部 Issue
相似的 Issue
-
step.duration reflects only the last retry attempt (HelperStep.run() overwrites startTime)可能已有人在做 @mirao 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
codeceptjs/CodeceptJS#5774 · 1 条评论 ·
维护者通常 2 天内回复
-
Status: Unconfirmed
难度 1/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
AllTheMods/ATM10-Aeronautics#151 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
feimacode/open-design-agent-kit#66 ·
维护者通常 1 天内回复