Skip to content

Commit

Permalink
feat(gateway): Block and CAR response formats (#8758)
Browse files Browse the repository at this point in the history
* feat: serveRawBlock implements ?format=block
* feat: serveCar implements ?format=car
* feat(gw): ?format= or Accept HTTP header

- extracted file-like content type responses to separate .go files
- Accept HTTP header with support for application/vnd.ipld.* types

* fix: use .bin for raw block content-disposition

.raw may be handled by something, depending on OS, and .bin
seems to be universally "binary file" across all systems:
https://en.wikipedia.org/wiki/List_of_filename_extensions_(A%E2%80%93E)

* refactor: gateway_handler_unixfs.go

- Moved UnixFS response handling to gateway_handler_unixfs*.go files.
- Removed support for X-Ipfs-Gateway-Prefix (Closes #7702)

* refactor: prefix cleanup and readable paths

- removed dead code after X-Ipfs-Gateway-Prefix is gone
  (ipfs/kubo#7702)
- escaped special characters in content paths returned with http.Error
  making them both safer and easier to reason about (e.g. when invisible
  whitespace Unicode is used)

This commit was moved from ipfs/kubo@4cabdfe
  • Loading branch information
lidel authored Mar 17, 2022
1 parent 8fc128f commit 3a09cab
Show file tree
Hide file tree
Showing 7 changed files with 596 additions and 395 deletions.
Loading

0 comments on commit 3a09cab

Please sign in to comment.