Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Content-type in Swarm #8

Closed
AuHau opened this issue Nov 26, 2019 · 3 comments
Closed

Content-type in Swarm #8

AuHau opened this issue Nov 26, 2019 · 3 comments
Labels
enhancement New feature or request P1 - High swarm Swarm related issues

Comments

@AuHau
Copy link
Contributor

AuHau commented Nov 26, 2019

Swarm has support for specifying content-type. Currently, it is possible to define content-type with .get(<<buffer>>, { contentType: 'plain/text' }) but only for raw files. When the data are given filename then it won't work the same as for Directories.

The support is hanging on implementing content-type support for directories which are uploaded as Tar files. According to input from Swarm team it is possible using xattr: user.swarm.content-type. It would be best to have this directly integrated using Erebos which will need some work on that part: MainframeOS/erebos#133


Old issue

Swarm has very tight coupling between files and their content-types.

IPFS, on the other hand, does not have any support for specifying the content type of files. It uses go mime sniffer for determinating it when serving files over gateway. There is accepted proposal ipfs/kubo#6214 that will enable this in the future, yet it is question when it will happen.

What should be our way? I see to options:

  • support content-types, but ignore it for IPFS
  • ignore content-types, and use raw mode for Swarm
@AuHau AuHau added to solve Thing that needs more thoughts P0 - Critical labels Nov 26, 2019
@AuHau
Copy link
Contributor Author

AuHau commented Nov 28, 2019

For now, resolved with #6

@AuHau AuHau closed this as completed Nov 28, 2019
@AuHau AuHau added enhancement New feature or request P1 - High swarm Swarm related issues and removed P0 - Critical to solve Thing that needs more thoughts labels Jan 4, 2020
@AuHau
Copy link
Contributor Author

AuHau commented Jan 4, 2020

Reopening this issue as direct support for content-type in Swarm was reverted and will need to be tackled again.

@AuHau AuHau reopened this Jan 4, 2020
@AuHau AuHau changed the title Content-type: IPFS vs Swarm Content-type in Swarm Jan 4, 2020
@AuHau
Copy link
Contributor Author

AuHau commented Jan 24, 2020

Solved with #52

@AuHau AuHau closed this as completed Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request P1 - High swarm Swarm related issues
Projects
None yet
Development

No branches or pull requests

1 participant