Return 412 for If-Match on a missing source instead of creating it

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

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

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

評価

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

調査の方向性

src/storage/version/put.js から始めて、作成パスが選ばれる前に If-Match ヘッダーがどこで解析されているかを追ってください。新しい 412 の返却が必要なのは、ソースが存在しない場合の分岐です。周辺の条件付きリクエストの処理を読み、If-Match: * と If-None-Match: * が現在の動作を保つことを確認してください。そのうえで、ストレージバージョンの既存の PUT テストの隣に、存在しないソースに対して特定の ETag を指定したケースを扱うテストを追加してください。その要求が書き込みなしで 412 を返し、作成専用パスが変わらなければ完了です。

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

説明

In src/storage/version/put.js, a PUT with a specific If-Match: <etag> on a missing source falls into the create path and creates it. A writer that expects to update a page re-creates it after someone deleted it.

Change

  • A specific If-Match: <etag> on a missing source → 412, no write.
  • If-Match: * on a missing source → 412 (already true today).

Compatibility: technically breaking, but only for requests that already break HTTP semantics: If-Match with an ETag must fail when the resource doesn't exist (RFC 9110 §13.1.1). Callers that mean "create or overwrite" send no condition, and "create only" sends If-None-Match: *; neither changes. A search of first-party repos (2026-11-22) found no affected client; da-collab sends If-Match: *, which already returns 412 here.

Before switching, log every If-Match: <etag> on a missing source in production for a few weeks. With no real hits, switch with a release note; otherwise the log shows which callers to contact first.

主要言語
JavaScript
スター
6
フォーク
18
平均マージ
5時間 12分
マージ済み PR(30日)
5

環境構築

はじめの一歩

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

adobe/da-admin のほかの issue

adobe/da-admin の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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