taskcluster / taskcluster-worker

Unfinished work on a general-purpose Taskcluster worker
19 stars 18 forks source link

Use mime sniffing to detect mimetype, fallback to file extension #252

Open jonasfj opened 7 years ago

jonasfj commented 7 years ago

We currently detect mimetype based on file extension... I propose that: 1) task.payload.artifact should have an optional contentType property 2) We should follow the mimesniff spec to detect mimetype, falling back to file-extension if that doesn't work.

Note:

Hence, minesniff is already implemented for us :)

jonasfj commented 7 years ago

So dustin made a good point that looking at contents might not be smart since it's less predictable..

petemoore commented 7 years ago

++ for adding optional artifact field - actually I was thinking the same thing, and never got round to documenting my suggestion!