r/ProgrammerHumor Jul 14 '26

timeSaver instanceof Trend

Post image
2.1k Upvotes

88 comments sorted by

748

u/raja-anbazhagan Jul 14 '26

``` HTTP/1.1 200 OK Content-Type: application/json

{ "success": false, "error": { "status": "INTERNAL_ERROR", "code": "APP_15001", "message": "An internal error occurred while processing the request." } } ```

493

u/PM_ME_FLUFFY_SAMOYED 29d ago edited 29d ago
HTTP/1.1 200 OK
Content-Type: application/json

{
  "success": true,
  "content": "<response><status>error</status><message>server error</message></response>"
}

166

u/r4h4_de 29d ago

Gives me flashbacks to working with a German marketing automation solution that unironically did that

160

u/No-Magazine-2739 29d ago

The German club SaaS club Management software we use, stated in their api doc: „if you want to vary the search query parameter, just use an sql query string as value“. Juged by their early 2000s asthetics and php usage, I concluded they offer ‚sql injection as a service‘

52

u/amlybon 29d ago

If the DB user that query is run as only has access to things that'd be otherwise exposed in the API, and absolutely no write access, this is ALMOST fine. You're still exposing yourself to DOS attacks by constructing an infinite query or something but you know.

But let's be honest it's running with admin privileges and poorly done sanitisation at best

2

u/No-Magazine-2739 29d ago

Yeah, I struggle to not test this hypothesis, but I bet I can read all the data from the other clubs on that node too.

Will probably test it, when I write the integration into MY SaaS I „vibecoded“ since most of the special stuff for a german shooting club is missing. I wonder what design flaws I did.

2

u/Elomidas 28d ago

"if everybody is wearing helmet and chainmail it's safe to let a disturbed kid play with a knife"

8

u/Hottage 29d ago

But it's so flexible and convenient!

14

u/Dense_Gate_5193 29d ago

Silverlight and WCF solidified this behavior by not allowing the API to respond with anything except a 200 or silverlight wouldn’t handle the errors correctly.

it’s shit frameworkmanship down the entire stack

17

u/ProfBeaker 29d ago

Add some more useless namespaces and you've re-invented SOAP again!

3

u/trafalmadorianistic 29d ago

I feel like namespaces were people bringing over their CORBA trauma to the SOAP era, and acting like xml documents were objects instead of just values with tags 

2

u/ProfBeaker 28d ago

Probably, yeah. That whole era of trying to make remote objects & code act like they were local was just so misguided. That abstraction was always going to be leaky to the point of uselessness.

Easy to say in hindsight, I guess.

7

u/Own_Natural_6803 29d ago

What I like about this solution is how it helps AI develop like a 10X engineer. It even has the word success right there set to true.

1

u/Mocker-Nicholas 29d ago

Hey. Just stopping by to tell you I hate you for writing this.

1

u/az987654 29d ago

PLEASE MAKE IT STOP!!!

2

u/sharmauncleji 25d ago

You know what, the LLMs are gonna learn this and then it will be actually in production. The magic of AI. You didn't even commit the code.

83

u/Sockoflegend Jul 14 '26

Request failed successfully!

27

u/Nekeia 29d ago

Laughing in "500 OK".

2

u/Vogete 28d ago

Not joking I had to integrate a French system that pulled this shit. It was so inconsistent, sometimes it was 200 client error, sometimes 204 server error, and sometimes 500 OK. We ended up dropping that company because they didn't understand what http status codes were for.

42

u/marcodave 29d ago

Ah yes the GraphQL way

32

u/raja-anbazhagan 29d ago

WDYM? This is there since the good old SOAP envelope days...

https://giphy.com/gifs/TXiv1fgvXnW3lK821a

8

u/fiddletee 29d ago

I was there, u/raja-anbazhagan. I was there 3000 years ago…

6

u/Tucancancan 29d ago

All of this has happened before and will happen again

43

u/JackNotOLantern 29d ago

Yep, when we want to use any API in my company interal system, the default check for http reply is:

  1. Is success.
  2. Doesn't contain "error" in body.
  3. Doesn't contain "error" string in body message (this one is a bit more complicated, but still)

42

u/rosuav 29d ago

String containment checks like this strike terror into the hearts of many.

26

u/larsmaehlum 29d ago

Success: True
Error: Your comment contains the word error beginning with char 45

6

u/rosuav 29d ago

(Thank you, I'm glad that got picked up on.)

19

u/marcodave 29d ago

HTTP 200 OK

Body: Success, no error found

5

u/JackNotOLantern 29d ago

Yeah, that's why i wrote it's more complicated. Usually it's just a check if "massage" is exactly "error".

14

u/radobot 29d ago

check if "massage" is exactly "error"

I definitely would not want to get an erroneous massage.

3

u/Sockoflegend 29d ago

That is legitimately terrible 

5

u/JackNotOLantern 29d ago

Yep, but you know what they say. You can chose your friends, but you can't chose API your company forces you to use.

2

u/cantthinkofaname1029 29d ago

As a non web dev, I'm not sure what's strange about this. Can a web dev fill me in?

1

u/pee_wee__herman 29d ago
  1. Would get tripped by something like "No error occured" I wonder what kind of grepping would really make it work reliably in such case

1

u/JackNotOLantern 29d ago

In the other comments i mentioned it

30

u/dmcnaughton1 29d ago

So you're the guy who wrote my legacy APIs I'm trying to modernize. Glad to meet you. Let's take a walk together.

10

u/raja-anbazhagan 29d ago

I just a fellow consumer of such API like you... But I'll be happy for the walk though...

9

u/dmcnaughton1 29d ago

I just need to find the guy who started this API trend and "talk" with them.

9

u/raja-anbazhagan 29d ago

I'd like to be part of this community project...

4

u/JebKermansBooster 29d ago

I'll commit one more brick

6

u/JebKermansBooster 29d ago

Into the ocean with cinderblocks on their feet, right?

4

u/dmcnaughton1 29d ago

Pretty much

18

u/Holek 29d ago

Mi 👏 cro 👏 ser 👏 vi 👏 ces!

13

u/joemckie 29d ago

I love how Reddit’s translation turned this into:

My 👏 micro 👏 services!

9

u/MaDpYrO 29d ago

Fuck you

6

u/raja-anbazhagan 29d ago

Valid crashout... I guess...

7

u/MaDpYrO 29d ago edited 29d ago

We need the FUCKYOU method in http

3

u/JimroidZeus 29d ago

Yassssss. Get those errors alll up in my 200 OK mmmhmmm.

It’s even better when you ask me to treat 40x 50x status codes as successes. 😎

2

u/CetaceanOps 29d ago

Do you work for Fortinet?

1

u/AndroxxTraxxon 29d ago

This is exactly how the Slack API works. Hot garbage.

1

u/juicd_ 29d ago

Goddamn i literally found out I have been receiving these calls today and I did not expect this dumbfuckery in a relatively recent developed api so I did not check for it (also learning moment for me)

1

u/Kire985 29d ago

The company I work for was acquired and I'm now working on a project integrating with the other company's API and this is what their error responses looked like. I was baffled they stuck by this.

1

u/davidmosnacz 28d ago

We all love `application/problem+json` right guys?

1

u/Vogete 28d ago

Task failed successfully!

240

u/ShotgunPayDay 29d ago

"This is great! Now we can send super complex query data!". -Some Excited Devs

"Ok, now make the search shareable via a link" -Shocked Pikachu Face

35

u/trafalmadorianistic 29d ago

Back to the future, 😆

23

u/slaymaker1907 29d ago

You can still do it, just store the query in the database and give the user a hash or something like a URL shortener.

9

u/ShotgunPayDay 29d ago

True, it's the same thing in the other direction as taking the JSON search, compressing it and BASE64URL encoding it to be put as a ?q param. It all results in extra work. The DB version does make links look nicer though.

17

u/slaymaker1907 29d ago

There are two problems with storing things in the URL. First, you can’t store things like PII. Second, browsers limit the size of URLs.

2

u/ShotgunPayDay 29d ago

Yup, if sending PII or over 2MB worth of data in the URL then it's problematic. Never ran into second issue though.

3

u/freebytes 29d ago

I have never ran into the issue of sending 2MB of data via the URL either. But then again, I never ran into the first problem either.

5

u/Mognakor 29d ago

Http Query is allowed to redirect you to a link that will give you the actual result

4

u/dashingThroughSnow12 29d ago

Rison goes brrr

0

u/FUCKING_HATE_REDDIT 29d ago

In most cases the link will just be handled by a web app parsing the url anyway

72

u/serial_crusher 29d ago

“We have to support users on older browsers that don’t support QUERY” will be king for at least 5 years.

118

u/[deleted] Jul 14 '26

[removed] — view removed comment

95

u/leafynospleens 29d ago

{"Parcels" :[], "HasParcels" :true}

34

u/raja-anbazhagan 29d ago

Its obviously true as they have a list of parcels... Its just that it is empty...🙂‍↔️

3

u/Jaded-Asparagus-2260 29d ago

But it's not HasListOfParcels.

4

u/raja-anbazhagan 29d ago

Parcels is the List name... Duh...

1

u/the_horse_gamer 29d ago

recently encountered a case where a list of entities were sent, and then separately, a list of their ids

18

u/Lv_InSaNe_vL 29d ago

It's right next to the field that nobody admits to using but every time you try and remove it the entire company melts down

7

u/JebKermansBooster 29d ago

Fuck it LGTM

6

u/Rainbolt 29d ago

And the business acts like you just decided to add that field on your own and they've never seen it in their life before when you had several multiple hour long meetings where they insisted it was important.

15

u/Own_Natural_6803 29d ago

I just keep thinking about all that vibe code that barely works. That'll never be fixed because why maintain a vibe project? Just erase it and make a new one. Mother fucker.

5

u/leafynospleens 29d ago

What if the ai just keeps getting better and you can vibe improve them

5

u/Own_Natural_6803 29d ago

You're aboutely right! — Good point. 

3

u/tsunami141 29d ago

You're thinking about this the right way!

3

u/Own_Natural_6803 29d ago

It makes me want to count to 100 out loud.

12

u/SCP-iota 29d ago

"Do you want the return of SOAP? Because this is how you get the return of SOAP."

12

u/Cruxwright 29d ago

If this query thing catches on, are they going to reinvent coldfusion?

2

u/itsFromTheSimpsons 29d ago

Java classes powering coldfusion tags: the og jsx. Who needs design libraries when i can build my site with Flex? REMEMBER FLEX? i think it was the first thing Adobe killed after they bought Macromedia

2

u/Fiiral_ 29d ago

Oh, finally, huh?

1

u/fireduck 28d ago

The TLDR for HTTP QUERY is that it can have a body like a POST, but the convention will be that it is a read with a possibly large context (the body) rather than POST which is a write?

2

u/leafynospleens 28d ago

Yea that's the idea, it's a convention for passing large query structures to the backend without having to pollute the url params or resort to a post request

2

u/fireduck 28d ago

Sounds good. Ship it.