pulltool / pulltool-chrome-app

Source for the Pull Tool Chrome App
MIT License
2 stars 1 forks source link

Type sniffing #26

Open stuartpb opened 7 years ago

stuartpb commented 7 years ago

It'd be nice if type could be implied by file extension in the source URL / filename (source or destination), and/or Content-Type on fetch (for sources), and/or some kind of duck typing (for patch bits).

What'd be most crucial would be establishing the precedence - I'm thinking it'd look like (highest to lowest):

stuartpb commented 7 years ago

The thing is, zip/tar/gz/targz files don't necessarily need to be extracted - but then we're in the world where we've got weird duck-typing logic and specs can have different behaviors that can't be predicted until the request completes.

Though I guess there's the "blobs require an as" rule right now, and anything without that is interpreted as an archive, and that's probably OK? (archives don't have as, they have slice.to iirc)