Create IPIP: UnixFS and Gateway support for explicit MIME/Content-Type
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Área
- api, backend-api-design, networking
Línea de trabajo
Comienza con el trabajo sobre las especificaciones de UnixFS registrado en #331; después, revisa la especificación de gateway referenciada y el controlador de gateway de Kubo en core/corehttp/gateway_handler_unixfs_file.go. El trabajo estará terminado cuando un IPIP defina el almacenamiento MIME canónico y el comportamiento del gateway, con una implementación de referencia de Kubo que cubra ipfs add y las respuestas del gateway.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- HTML
- Estrellas
- 1.2k
- Forks
- 250
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ipfs/specs
-
Simplify Spec StatusesAbiertoneed/triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Revise steward and editor rolesAbiertoneed/triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
-
dnslink:// URIsAbiertoneed/triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
need/triage
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Todos los issues de ipfs/specs
Issues similares
-
bug cross-seed ready-for-human
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ElectronicWave/Elemental#265 ·
Los mantenedores suelen responder en 1 día
-
Waiting start: the fixed 503 body says another instance holds the lease when that may not be soAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Judgment-Pack/judgment-pack-gateway#474 ·
Los mantenedores suelen responder en 1 día
-
feature needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
BoardGamesEmpire/board-games-empire-backend#1306 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100