Android: a media delete failure other than IOException loses its CORS headers
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 79/100
調査の方向性
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日 11時間
- マージ済み PR(30日)
- 75
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
agent bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
bug 🐛
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
comunica/comunica#1925 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信