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

Nemo_bis created this task.May 11 2016, 6:09 AM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 11 2016, 6:09 AM
Nemo_bis added a subscriber: Ijon.
Restricted Application added a project: Analytics. · View Herald TranscriptMay 11 2016, 6:10 AM

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

Nuria added a subscriber: Nuria.May 16 2016, 4:43 PM

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.