IATI / IATI-Datastore

An open-source datastore for IATI data with RESTful web API providing XML, JSON, CSV plus ETL tools
http://datastore.iatistandard.org/
Other
1 stars 0 forks source link

I can output csv files with custom filenames #250

Closed andylolz closed 6 years ago

andylolz commented 7 years ago

The csv routes aren’t sufficiently strict about the bit between the final segment of the route and the ‘csv’ ending E.g. both /api/1/access/budget.csv and /api/1/access/budgets.csv work:

In fact, the following custom filename hack also works:

http://datastore.iatistandard.org/api/1/access/budgettt.Hey_look.A_custom_filename.csv

Kind of cool. But probably worth fixing. I suspect checking the value of format rather than request.path.endswith would do the trick.

dalepotter commented 7 years ago

Issue reopened as this is the subject of pull request into the production version of the code: https://github.com/IATI/IATI-Datastore/pull/258

andylolz commented 6 years ago

Closing because this was fixed by #251 (although the related tests in #263 – requested in #258 and originally the blocker for pushing this live – have not been merged).