textileio / textile

Textile hub services and buckets lib
MIT License
226 stars 45 forks source link

Hub gateway doesn't support HTTP Range queries #560

Open carsonfarmer opened 3 years ago

carsonfarmer commented 3 years ago

The default IPFS gateway's support this HTTP header, which is pretty much required for serving video content. Currently, our gateway does not. In fact, browser apps get a CORS error on preflight requests because we don't support this header. Is there an easy path to supporting Range Queries?

Screen Shot 2021-06-15 at 4 14 20 PM

cc @sanderpick

carsonfarmer commented 3 years ago

There are essentially two components to this issue. One is simply allowing HTTP Range headers in the first place, and the second is then actually supporting partial requests and range queries. The default IPFS gateway uses the built in Golang http.serveContent() method, which should be properly parsing Range HTTP headers and only returns the content in the range the client requested, so we would likely have to do something similar, or support Range HTTP headers directly ourselves.