Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Android: a media delete failure other than IOException loses its CORS headers

オープン 初心者向け
#847 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
79/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
kotlin
領域
backend, mobile

調査の方向性

MediaUploadServer.handleDeleteを読み、例外処理をpassthroughResponseおよびprocessAndRespondと比較してください。キャンセル以外の例外にはCORSヘッダー付きのサーバー応答が返され、CancellationExceptionは再スローされることを確認してください。削除の失敗がCORSのないフォールバックの500応答にならないことも確認してください。

索引モデルが issue の本文から書いたものです。

説明

[Type] Bug Android

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

wordpress-mobile/GutenbergKit のほかの issue

wordpress-mobile/GutenbergKit の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。