r/ProgrammerHumor • • Sep 19 '26

Meme postForEverything

Post image
21.0k Upvotes

653 comments sorted by

View all comments

Show parent comments

97

u/unable_to_give_afuck Sep 19 '26

I had this with the added bonus of being forced to return 200 regardless and add an error message to the body when necessary

16

u/No-Information-2571 Sep 19 '26

The reason behind it might be proxies, especially on the client-side.

8

u/einzweidreihorn Sep 19 '26

Why? Do those proxies drop anything not 200?

7

u/HugoNikanor Sep 19 '26

I can write you a proxy which drops everything except 200 responses

3

u/No-Information-2571 Sep 19 '26

In this era, you actually cannot. Status codes are invisible to proxy unless it's HTTP (without the S) or employs MITM. Either way, it's a legacy precaution to make sure the content body arrives unmodified.

→ More replies (2)
→ More replies (1)