Skip to content

Allow HTTP/HTTPS URIs that do not end in .zip #6351

Open
@ndoo

Description

@ndoo

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''.

if (httpsDataSourceMetadata.isZipContentType() || uri.getPath().endsWith(".zip")) {

There are some workarounds;

  1. Manually downloading the files with ''wget --trust-server-names'' before building
  2. 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:

  1. I have written to the Malaysian government to request addition of the Content-Type: application/zip header
  2. Add a flag to build-config.json -> transitFeeds -> ? e.g. ignoreFileExtension perhaps
  3. Perform URI validation later in the process, after any redirections have taken place

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThis issue is stale, no activity for 90 days. Remove stale label or comment within 30 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions