Skip to content

Commit

Permalink
add RFC
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jun 16, 2022
1 parent f9b5370 commit fb5678f
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions RFC/0000-gateway-tar-response-format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# RFC 0000: Gateway TAR Response Format

- Start Date: (format: 2022-10-10)
- Related Issues:
- https://github.com/ipfs/specs/pull/288
- https://github.com/ipfs/go-ipfs/pull/9029
- https://github.com/ipfs/go-ipfs/pull/9034

# Summary

Add TAR as a response format for the HTTP Gateway.

# Motivation

Currently, the HTTP Gateway only allows the download of single files, or
CAR archives. However, CAR files are sometimes not necessary and user may
want to download entire directories. An example use case is for the IPFS
Web UI, where users are able to download files or directories.

# Detailed design

The solution is to allow the Gateway to support producing TAR archives
by requesting them using either the `Accept` HTTP header or the `format`
URL query.

## Test fixtures

Not applicable as different TAR archives may produce different byte-to-byte files.

## Design rationale

The current gateway already supports different response formats via the
`Accept` HTTP header and the `format` URL query. This RFC proposes adding
one more supported format to that list.

### User benefit

Users will be able to directly download UnixFs directories from the gateway. In the Web UI,
for example, we will be able to create a direct link to download the file, instead of using the
API to put the whole file in memory before downloading it, saving resources and avoiding bugs.

### Compatibility

This RFC is backwards compatible .

### Security

See below.

### Alternatives

An alternative was considered to also support [Gzipped TAR](https://github.com/ipfs/go-ipfs/pull/9034).
However, there is a concern that that may be a vector for DOS attacks since compression requires
high CPU power.

### Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

0 comments on commit fb5678f

Please sign in to comment.