I am trying to determine the filetype of a resource based on the header of the file, without downloading the entire file, e.g. using this npm package: https://www.npmjs.com/package/file-type
It should be possible using a readableStream. But I haven't gotten this to work yet. Can it also be done by getting the first kilobyte or so, using https://developer.mozilla.org/en-US/docs/Web/API/fetch, by setting some headers?