geocodezip / geoxml3

Automatically exported from code.google.com/p/geoxml3
102 stars 87 forks source link

fetchDoc() determines file type based on URL instead of actual content type #123

Open JoshMcCullough opened 5 years ago

JoshMcCullough commented 5 years ago

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.