News for hackers. Stuff that matters.
Re:Handling cookies is a minefield by ndusart on Friday November 22, 2024 @03:21AM (#42212072)
So, just be as conservative as possible when you produce data and as liberal as possible when you receive something. Your code will then require the least cooperation from *any* other code to be compatible with.

Doing otherwise will require cooperation to adjust on the specificities clients expect, and you fall into the trap of the prisoner dilemna.

Re:Handling cookies is a minefield by marcosdumay on Friday November 22, 2024 @08:55AM (#42213849)
No, when you create a protocol define exactly what you need what is optional and what is an error, and stick to that.

Being liberal on what you accept is a path for disaster.

Re:Handling cookies is a minefield by ndusart on Friday November 22, 2024 @02:33PM (#42216713)
You changed the problem. Postel's law is not about writing the protocol but implementing it.

Sure, protocol should be designed to be as specific as possible but unfortunately these are not always defined up to that point for any good or bad reasons, and we generally are at best just in the implementation side and cannot influence the writing of the protocol, so the Postel's law is the best we can apply to avoid having to cooperate with the rest of the planet.

Re:Handling cookies is a minefield by marcosdumay on Saturday November 23, 2024 @10:59AM (#42221545)
From wikipedia:

> The principle is also known as Postel's law, after Jon Postel, who used the wording in an early specification of TCP.

Re:Handling cookies is a minefield by ndusart on Monday November 25, 2024 @01:23AM (#42233748)
From the mentioned specification:

> TCP implementations should follow a general principle of robustness: be conservative in what you do, be liberal in what you accept from others.

Better to look in the sources ;)