News for hackers. Stuff that matters.
Re:Browsers barely care what HTTP status code your web pages... by bawolff on Friday August 11, 2023 @04:56AM (#37086564)
Tbf, 500 is the appropriate error message for user has broken the server.
Re:Browsers barely care what HTTP status code your web pages... by jeroenhd on Friday August 11, 2023 @12:29PM (#37090570)
5xx means the server messed up, if the user should've done something different you'd see a 4xx error.

A good web server validates the user input, throws a 4xx error if the input is bad for the current state, and if something still goes wrong (which is a server bug) the 5xx range becomes appropriate.

Re:Browsers barely care what HTTP status code your web pages... by david422 on Friday August 11, 2023 @01:05PM (#37091012)
That's what he just said though. User breaks the server is a 500. Server prevents the user from breaking the server is a 400.
Re:Browsers barely care what HTTP status code your web pages... by jeroenhd on Friday August 11, 2023 @02:09PM (#37091880)
But a 500 isn't the user breaking the server, it's the server being broken before the user ever came in.

Users and client software cannot (or rather, should never) be held responsible for 500 error codes, which "user breaks the server" implies.

Re:Browsers barely care what HTTP status code your web pages... by bawolff on Friday August 11, 2023 @10:12PM (#37096293)
400 is a client error. 500 is server error. A server error induced by a client action (e.g. triggering an unexpected exception) is still a server error.