Page MenuHomePhabricator

Invalid API input returns 404 instead of 500 or 400
Closed, DuplicatePublic

Description

Found by Asaf: https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/He.wikipedia/all-access/user/%D7%A1%D7%A4%D7%A8%D7%99%D7%99%D7%94_%D7%93%D7%99%D7%92%D7%99%D7%98%D7%9C%D7%99%D7%AA/daily/20160501/20160531 returns error 404 due to that uppercase "He.wikipedia". When a parameter other than the title isn't recognised, the status code should not be 404 but 500 or 400 (many webservers would return 403 though).

Event Timeline

It's not an Internal Server Error (500) if you give bad input.

The problem here is how to decide whether this is a project for which we count pageviews (we do not count pageviews yet for ALL projects)

Now, one thing to do here would be to lowercase any project that gets passed in.

I'm confused by the merge. I don't care about the error message, only about the status code.