mojira.dev
WEB-896

Looking up invalid minecraft uuid/player name returns 204 (instead of expected 404)

If you go to an invalid player's URL, nothing happens. No error, nothing.
Example: https://api.mojang.com/users/profiles/minecraft/bageeeeeeethr
When I try to access a player's username, I can't check to see if it's an invalid name first.
What gives?

I guess this is for suggestions so:
Proposed Suggestion:

  • Make an error page when an invalid's user page is accessed. E.g. { error: "Player not found"} or some sort of failover.

Linked issues

Attachments

Comments 4

Sorry for the delay in this action.

WEB is the correct project for issues with the Mojang API - MCAPI is for something different and much older.

Per wiki.vg:

If there is no player with the given username an HTTP status code 204 (No Content) is sent without any HTTP body.

But I have to agree that this is somewhat weird of a design.

I realize it's been a couple of years since this report was filed, but I feel like a response and a resolution is still fitting.

While I was not working at Mojang when this decision was taken, I do not see 204 as a bug or an incorrect response code in this case to inflict a breaking change in what code we would return.

According to RFC 2616, 4XX codes should be treated as client errors - the request contains bad syntax and the server cannot fulfill it. But this endpoint was designed to be used by a client to query if a profile name is taken - the request does not contain bad syntax, the server was able to fulfill it, and we do not consider that client performing something erroneous. On the contrary, the action was successfully received, understood, and accepted, which is the description for 2XX codes. Then we separate between a response that contains data (200) and an empty response (204).

I will go ahead and close this bug report as working as intended.

There is inconsistancy between the api outputs with thee user ImProdex as showen in the pictures below

[media][media]

Dear Ined,

According to Section 10.4.5 of the linked RFC 2616, is "The server has not found anything matching the Request-URI." which is accurate, there is no profile found.

You say it's not a client issue, what exactly led you to believe this? The client requested a username that doesn't exist, is this not the fault of the client for passing a nonexistent username?

In this case, it should be up to the server to state an Error 404, illegal username passed, with a body explaining why, in this case, no valid username. It's the responsibility of the server to tell the client what they sent is not valid, which is accurate, in this case.

Additionally, the "or" portion of "4xx: Client Error - The request contains bad syntax or cannot be fulfilled" seems to be neglected. The request for a user cannot be fulfilled, as they do not exist. If this were a server issue, and not a client issue, we have the 5xx territory.

That's just my 2 cents on it. 

chewsterchew

(Unassigned)

API

Retrieved