RangerMauve / hypercore-fetch

Implementation of Fetch that uses the Hyper SDK for loading p2p content
MIT License
37 stars 13 forks source link

Support `redirect` field #18

Open RangerMauve opened 3 years ago

RangerMauve commented 3 years ago

Right now we internally resolve files and return responses as though the user loaded the resolved file.

This should optionally be disabled and 302 responses should be sent.

The redirect flag is what handles this in regular fetch.

So if a user sets redirect to manual, we would resolve the file, and return a 302 redirect so that the protocol handler or user can resolve themselves if they so choose.

We should also consider whether we should return a 302 redirect when a request gets made for a DNS address or a named drive. I think DNS doesn't make as much sense since you'd want to preserve the origin, but named drives could make sense so that users are less confused as to how to get the actual URL of the drive they created.