You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During my manual tests of #109, I noticed that when the base schedule is not available, we get a text/plain error currently.
Here is an example, using a local test config and querying http://localhost:8080/test:
HTTP/1.1 502 Bad Gateway
content-length: 170
connection: close
content-type: text/plain; charset=utf-8
date: Mon, 18 Jan 2021 10:01:12 GMT
theoretical dataset temporarily unavailable : impossible to read GTFS http://localhost:8000/SEM-GTFS.zip because Invalid Zip archive: Could not find central directory end
Since the whole API is JSON, I believe standardising on JSON content-type of errors would be better for the end-user life.
The encoding is also not set as a header, leading to this output on some browsers:
It would be a good idea to fix this at the same time, with a Content-Type: application/json; charset=utf-8 (but maybe just switching to JSON) will correct that as well, actually.
thbar
changed the title
Errors sent in text/plain rather than json content-type
Errors are sent in text/plain rather than json content-type
Jan 18, 2021
During my manual tests of #109, I noticed that when the base schedule is not available, we get a
text/plain
error currently.Here is an example, using a local test config and querying
http://localhost:8080/test
:Since the whole API is JSON, I believe standardising on JSON content-type of errors would be better for the end-user life.
Useful resources
The text was updated successfully, but these errors were encountered: