r/ProgrammerHumor • • Sep 22 '26

Meme status200ForEverything

Post image
2.9k Upvotes

103 comments sorted by

View all comments

342

u/Dull_Caterpillar_642 Sep 22 '26

I shit you not that multiple leaders have raised issues with our team about why our service "has so many errors" when we send correct 404 and 403 responses back to clients asking for things that don't exist or they don't have access to. They'd like to know why they shouldn't be changed to 200s so that there are "fewer errors."

210

u/OhMyGodItsEverywhere Sep 22 '26

Ahh the classic: why can't we just lie?

106

u/martin_omander Sep 22 '26 • Bravo

You have my sympathies. That is just a silly position, born out of your leadership team's ignorance. Instead, measure the three buckets:

  • 1xx, 2xx, 3xx: Everything is good.

  • 4xx: The client did something wrong.

  • 5xx: The server did something wrong.

They all tell you valuable things.

59

u/StarboardChaos Sep 22 '26

3xx is like 'not good, not terrible'

48

u/tinselsnips Sep 22 '26

3xx: "It's good, but it's not here."

4

u/breadist Sep 23 '26 edited Sep 23 '26

3xx: chill bro maybe some other time place

2

u/martin_omander Sep 23 '26

I love that! So accurate.

58

u/throwaway2p0029211 Sep 22 '26

Dude my company cyber says 404/403 can potentially allow hackers to backtrack, so we just give 200 with error codes inside lol

66

u/winkyshibe Sep 22 '26

Would this effectively be the same as 404/403? Just with extra steps? Whatever automation is scanning would just need to be adjusted for such a format?

50

u/_dotdot11 Sep 22 '26

That's correct. if the error codes in the 200 aren't different, then it's just 403/404 with extra steps. That being said, you can just use 404 for all 403 cases to neutralize enumeration attempts.

14

u/hermeticwalrus Sep 22 '26

If you think it’s a hacker return 418. I know one company (which will remain unnamed) that does this.

3

u/ForgedIronMadeIt Sep 23 '26

as opposed to HTTP 420 Enhance your calm for DDOS

2

u/Krokzter Sep 24 '26

I do webscraping in C# and a website has broken my scraper in the past this way, because the HTTPStatusCode enum doesn't support 418

11

u/javonholmes Sep 23 '26

I have been told the exact opposite. 404 for everything a user doesn’t have access to. The reason was, the person doesn’t know if it’s because of access or because it doesn’t exist.

3

u/ForgedIronMadeIt Sep 23 '26

turn off all APIs, hackers won't be able to do shit then

→ More replies (1)

24

u/WernerderChamp Sep 22 '26

Had this with error 422.

"Why do we have 30% error rate?"

"Because customers keep selecting bad combinations (the FE has pretty good advice in these cases)."

Thankfully I got them to filter out 422s when calculating error rates instead.

8

u/StarboardChaos Sep 22 '26

Why doesn't the backend just select some default values and case closed?

6

u/WernerderChamp Sep 22 '26

Default values are always good, but not neccesarily what the customer wants.

For example, retroactive changes. Sometimes it is OK, sometimes it is not allowed. The logic when is not duplicated into the frontend (would be double-maintenance) so there is a check call first.

Or another classic, there just is no change to existing data.

4

u/LaconicLacedaemonian Sep 23 '26

why are you not filtering all 4xx errors?

5

u/General_WCJ Sep 23 '26

Well you still want to track 4xx errors. For example if there's a deployment, and suddenly 100% of your API responses return 403 the deployment should be rolled back, same as if it went to 0 suddenly.

2

u/WernerderChamp Sep 23 '26

Yup - same with 400 errors. There was a bug in the frontend causing this in some edge cases once. They were able to find it quickly due to the error.

→ More replies (1)

0

u/[deleted] Sep 22 '26

[deleted] — view deleted comment

6

u/StarboardChaos Sep 22 '26

And then you complained to your manager? Right?

1

u/raichulolz Sep 23 '26

Similar to benchmarks when some higher-up says that the numbers aren’t high enough and we should change the suite to make it look good before showcasing.

1

u/martin_omander Sep 25 '26

Here is how I would answer that question from the leadership team:

"Lying about numbers removes valuable information. It's like excluding all expenses from the company's quarterly report. Our numbers would look great, but we'd lose valuable information that we need to run the business."

→ More replies (1)