Open
Description
Malaysia's GTFS feeds neither returns a ''Content-Type: application/zip'' header nor ends in a .zip extension (the API server performs 2 HTTP redirects which then contains the .zip extension).
URLs for testing can be found here: https://developer.data.gov.my/realtime-api/gtfs-static
Thus, the following line of code rejects GTFS API URLs for Malaysia if configured in ''build-config.json''.
There are some workarounds;
- Manually downloading the files with ''wget --trust-server-names'' before building
- Using the redirect destination URL https://openapi-malaysia-transport.s3.ap-southeast-1.amazonaws.com/mybas-johor/gtfs_mybas.zip which is not guaranteed to be stable
I have some suggestions to make this work:
- I have written to the Malaysian government to request addition of the Content-Type: application/zip header
- Add a flag to build-config.json -> transitFeeds -> ? e.g. ignoreFileExtension perhaps
- Perform URI validation later in the process, after any redirections have taken place