gateway: support for UnixFS 1.5 Last-Modified/If-Modified-Since with remote CAR backend
- Dominant language
- Go
- Stars
- 316
- Forks
- 163
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 8
Description
https://github.com/ipfs/boxo/pull/659 introduced support for returning optional UnixFS 1.5 mtime value as `Last-Modified` header, and returning `304 Not Modified` if it is matching `If-Modified-Since` sent with a file request.
This
- :green_circle: works with `gateway/backend_blocks.go` (used by [Kubo](https://github.com/ipfs/kubo) and [Rainbow](https://github.com/ipfs/rainbow/))
- :construction: but does not work with `gateway/backend_car.go` (used in [boxo/gateway conformance tests here](https://github.com/ipfs/boxo/blob/3cd3857b046c3d26494c6e9a34dbcee707413648/.github/workflows/gateway-conformance.yml#L145-L150) and in Rainbow with [`RAINBOW_REMOTE_BACKENDS_MODE=car`](https://github.com/ipfs/rainbow/blob/main/docs/environment-variables.md#rainbow_remote_backends_mode))
Remaining work here:
- [ ] prerequisites
- [ ] figure out what is missing in `loadTerminalEntity` from `gateway/backend_car.go` to be able to read `mtime` from the root dag-pb block of requested file, update any upstream libraries if necessary
- [ ] car backend
- [ ] return `Last-Modified` on deserialized GET responses
- [ ] return `Last-Modified` on deserialized HEAD responses
- [ ] 304 Not Modified on matching `If-Modified-Since` (UnixFS 1.5 file only)
- [ ] add gateway-conformance test for unixfs 1.5 and release it as new major version
- [ ] confirm conformance passes with all backends (remote car uses different implementation of `Get` and `Head` and `ContentPathMetadata` needs to be updated there as well -- this is why conformance tests need to be added after we have car backend implemented first)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.