gateway: CORS and `Cache-Control: only-if-cached`

オープン
#400 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
領域
documentation

調査の方向性

issue にリンクされている path-gateway の HTTP gateway 仕様の Cache-Control リクエストヘッダーのセクションから始めてください。Cache-Control: only-if-cached を使用する CORS リクエストがどのように記述されているかを確認し、そのうえで Access-Control-Allow-Headers に必要な動作を文書化し、そのヘッダーを設定するだけで十分かどうかを明確にしてください。

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

説明

need/triage

Without this you cannot make a CORS request for content with the Cache-Controle header.

For example, this request to check if the gateway has the cid in cache fails (from a different origin):

await fetch(new Request(`${url}/ipfs/${cid.toString()}/`, { method: 'HEAD', headers: { 'Cache-Control': 'only-if-cached' } }))

A server should be able to fix this by setting the header

"Access-Control-Allow-Headers"="Cache-Control"

This should probably be mentioned here: https://specs.ipfs.tech/http-gateways/path-gateway/#cache-control-request-header.

I believe @lidel mentioned setting this header alone might not be enough, but from some local testing, it seems to work fine(?)

主要言語
HTML
スター
1.2k
フォーク
250
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

ipfs/specs のほかの issue

ipfs/specs の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

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

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