Create IPIP: UnixFS and Gateway support for explicit MIME/Content-Type
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
調査の方向性
#331 で追跡されている UnixFS 仕様の作業から始め、参照されている gateway 仕様と、core/corehttp/gateway_handler_unixfs_file.go にある Kubo の gateway ハンドラーを確認してください。IPIP が標準 MIME ストレージと gateway の動作を定義し、ipfs add と gateway のレスポンスを対象とする Kubo のリファレンス実装が用意された時点で、作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
This is a placeholder issue for creating IPIP to add support for storing explicit MIME/Content-Type in UnixFS DAG itself, like we already do for opt-in mode and mtime, and acting on its presence on Gateways.
There is alrernative approach to allow stating explicit content-type header via _headers file (similar to recently shipped _redirects) – some notes in https://github.com/ipfs/specs/issues/257
Context
UnixFSv2 never happened, but ability to explicitly specify Content-Type was one of my asks: https://github.com/ipld/legacy-unixfs-v2/issues/11
Years later, we still guess Content-Type on gateways.
While it is fine for most of the time, but we should provide users with ability to explicitly set media type at the time of data onboarding.
Since 2018 we made some related development: we've added opt-in support for mode and mtime attributes. ~2020 (https://github.com/ipfs/specs/issues/217#issuecomment-582369839). Support for mode and mtime was implemented in JS-IPFS a while ago, Kubo still has PR open (https://github.com/ipfs/go-unixfs/pull/117).
Initial idea (details to be fleshed out in IPIP) is to introduce optional mtype similar way.
This is alternative to introducing _headers file mentioned in https://github.com/ipfs/specs/issues/257.
Ref.
- old discussions https://github.com/ipfs/kubo/issues/2164
- Media Type registry at IANA: https://www.iana.org/assignments/media-types/media-types.xhtml
- IETF RFC about Media Types https://www.rfc-editor.org/rfc/rfc2046.html
- Some examples how the same CID can be returned with different
Content-Type: https://github.com/ipfs/in-web-browsers/issues/152 - Kubo Gateway guessing
Content-Typebased on filename and magic bytes: https://github.com/ipfs/kubo/blob/v0.17.0-rc2/core/corehttp/gateway_handler_unixfs_file.go#L55-L87- Gateway support for overriding filename: https://github.com/ipfs/specs/blob/main/http-gateways/PATH_GATEWAY.md#filename-request-query-parameter
- IPFS users leverage this for adjusting Content-Type when
/ipfs/cidis requested without any filename, but with built-in support for explicit content type we could make it "just work".
- IPFS users leverage this for adjusting Content-Type when
- Gateway support for overriding filename: https://github.com/ipfs/specs/blob/main/http-gateways/PATH_GATEWAY.md#filename-request-query-parameter
TODO
- wait until UnixFS specs land (#331)
- create IPIP against UnixFS specs that
- defines canonical way of storing explicit MIME (content/media type) in UnixFS root dag-pb blocks.
- modifies Gateway spec to disable mime-sniffing and use sanitized (ASCII-only) value from dag-pb in
Content-Typeheader
- Create reference implementation in Kubo
- adds optional
--content-typetoipfs add - skip sniffing and set
Content-Typeheader on gateway, if present
- adds optional
- 主要言語
- HTML
- スター
- 1.2k
- フォーク
- 250
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ipfs/specs のほかの issue
-
need/triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
need/triage
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
dnslink:// URIsオープンneed/triage
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
need/triage
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
似ている issue
-
bug cross-seed ready-for-human
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ElectronicWave/Elemental#265 ·
メンテナーはふだん 1 日以内に返信
-
Waiting start: the fixed 503 body says another instance holds the lease when that may not be soオープン
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
Judgment-Pack/judgment-pack-gateway#474 ·
メンテナーはふだん 1 日以内に返信
-
feature needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
BoardGamesEmpire/board-games-empire-backend#1306 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100