ppy / osu-api

Public API for accessing osu! related data.
320 stars 16 forks source link

/get_user will search by username even if type=id is specified #244

Closed minwoo0jo closed 5 years ago

minwoo0jo commented 5 years ago

Even if type=id is specified on the /get_user query, if the user with the user id is either restricted or doesn't exist, instead of returning an empty result (indicating invalid user id), it will actually search by username instead.

For example, the user with the userid 120 does not exist, but a user with the username 120 exists. If I query for the userid 120 with type=id specified explicitly I will get a false positive and get the wrong user.

I understand that this is the intended behavior if type is not specified, but I would like to get the empty set if type is specified.

peppy commented 5 years ago

I've made this change. Please confirm you are seeing what you expect to now.

minwoo0jo commented 5 years ago

Yes, I can confirm that it works on my side now. I get an empty result if the id does not exist and the username exists as long as type=id is specified as long as the query is still a number