2 ms·
Darned if I'm going to say Postel's wrong, but it feels like long-term pain to me. If you accept invalid input and process it, then you're saying that it's de-f
by kstrauser 3y ago
Darned if I'm going to say Postel's wrong, but it feels like long-term pain to me. If you accept invalid input and process it, then you're saying that it's de-facto good input. Other systems come to depend on those undocumented extensions, and now you're stuck supporting it forever. I can imagine a million ways that could lead to security problems. Even if that weren't an issue, it's definitely a maintenance problem.
For example, suppose you specify that a web service accepts JSON. It also accepts things like `{foo:"bar"}` as identical to `{"foo":"bar"}`, because hey, it's clear what the client meant. Guess what: now you can never switch to using an off-the-shelf JSON parser. You were trying to be nice to the client, but screwed yourself up in the process. Don't do that.
- bsder 3y agoPostel's Law is good when the group is cooperative. Postel's Law is really bad once malicious actors show up.
- o11c 3y agoIt doesn't require malicious actors, just independent ones. "Cooperative" was a good choice of word there.
- robotresearcher 3y agoWe have long term pain and the Internet. It wasn’t inevitable. Making stuff just about work as quickly as possible was key to bootstrapping a global open network. I don’t have evidence for this, or much of an argument. Just a hunch.
- kstrauser 3y agoFair point. And plenty of people have heard of Postel's Law, because he's smart as hell and has earned us paying attention to his words. You haven't heard about my Laws, perhaps the most popular being "duct tape can fix anything, ergo nanomachines smaller than a duct tape molecule can't work", because I'm just some rando on the Internet. I think it was a perfectly reasonable rule of thumb for the time he said it. I'm 100% onboard a modern variant like "be liberal in what you accept by returning an appropriate error code instead of crashing", e.g. an HTTP 400 for invalid data instead of a 500.