The fetchDoc function attempts to determine the file type based on the provided URL. If it is unable to do so, it defaults to JSIO.FileType.Unknown, which it then treats as a zip file.
This is an issue if the file is served dynamically e.g. https://my.biz/files/1002, where the URL does not actually end in a filename at all.
fetchDoc should do a HEAD request to determine the content-type of the file first, and then use that information primarily, falling back to using the current logic.
The
fetchDoc
function attempts to determine the file type based on the provided URL. If it is unable to do so, it defaults toJSIO.FileType.Unknown
, which it then treats as a zip file.This is an issue if the file is served dynamically e.g.
https://my.biz/files/1002
, where the URL does not actually end in a filename at all.fetchDoc
should do aHEAD
request to determine the content-type of the file first, and then use that information primarily, falling back to using the current logic.