chriskuehl / fluffy

A file-sharing web app that doesn't suck.
https://fluffy.cc
Other
173 stars 22 forks source link

curl a fluffly link should give you the raw content (no html) #62

Open matfra opened 6 years ago

matfra commented 6 years ago

That would be neat!

chriskuehl commented 6 years ago

Agreed, would definitely be cool. I'm not sure if there's an easy way to implement it right now though. The way the storage backends work is that fluffy hands them files (the rendered HTML as well as the raw text), and then the backends (e.g. S3) serve requests themselves.

There's not actually a server component involved when serving uploaded files. E.g. the HTML you see at https://i.fluffy.cc/D9rfD13wBLl5JHcjKH1HbtDGRZH0Wrkj.html is actually the S3 object s3://fluffy.cc/D9rfD13wBLl5JHcjKH1HbtDGRZH0Wrkj.html.

I don't think there's a way to get S3 to serve a different file based on the user agent, so this would probably mean a pretty big refactor to fluffy's architecture. A refactor would help with some features (like this) but also have some downsides we'd have to balance.

Definitely worth considering, I'll leave this ticket around although it's probably a long-term thing.