News for hackers. Stuff that matters.
Re:I've been abusing HTTP Status Codes in my APIs for years by quesera on Wednesday July 13, 2022 @01:55PM (#32086331)
"SHOULD" has a very specific meaning in RFCs. Contrast to "MUST".

Unless the user can fix the problem, and you want them to try, an explanation of a 5xx error adds no value. Again, I don't think 5xx is ever a valid response from an API -- it's always a server-side error (code or infrastructure) that needs fixing, often with high priority.

In many environments (e.g. medical, financial, or other secure/private), providing details on server errors is strongly discouraged. Even when the data isn't sensitive, I think you're asking for trouble by broadcasting server-side problem details to users.

Re:I've been abusing HTTP Status Codes in my APIs for years by d1sxeyes on Thursday July 14, 2022 @07:53AM (#32094694)
Fair enough. You've convinced me on this - especially on the 5xx I think it's a very good point that a description of the error could potentially have undesirable consequences.

I think my original point stands though, that status codes do tell you about the body in some circumstances. Or SHOULD tell you something about the body at least :)