GET /u/by-external/{id}.json returns HTML on 404

The 404 response for /u/{username}.json returns JSON as expected:

{"errors":["The requested URL or resource could not be found."],"error_type":"not_found"}

However, /u/by-external/{external_id}.json doesn’t have the same behaviour. It returns JSON on success, but HTML on 404 (and I would assume for other errors as well), confusing my JSON parser.

1 Like

@eviltrout perhaps this is one route that was missed in the rename?

This is unrelated to the path change – by-external needs some hacks to recognize the format which NotFound was not respecting.

(long term we should probably figure out a nicer way around those hacks)