News for hackers. Stuff that matters.
Re:If your code accepts URIs as input, filter out “file://” by mootothemax on Monday September 12, 2016 @07:18AM (#12478734)
>https://en.m.wikipedia.org/wiki/Robustness_principle

You need to be careful of where you place the emphasis on that, though:

Be -liberal- in what you accept.

vs

Be liberal in what you -accept-.

Re:If your code accepts URIs as input, filter out “file://” by artursapek on Monday September 12, 2016 @07:27AM (#12478764)
Right - you accept URIs. That's fairly liberal.

> Be conservative in what you do

However, you only handle specific schemes and ignore the rest.

Re:If your code accepts URIs as input, filter out “file://” by mootothemax on Monday September 12, 2016 @07:38AM (#12478825)
Yeah, apologies, I was being pretty petty.

My hopefully-better-expressed point is that it's easy to interpret the robustness principle in different ways, some of which lead to better code, and some of which... don't.

Re:If your code accepts URIs as input, filter out “file://” by artursapek on Monday September 12, 2016 @12:40PM (#12481205)
No worries. I think the philosophy is rooted in the fact that you can't control what other parties will send you; you can only control what you send in response. So that's the main thing to keep in mind.

It's sort of like the good life advice you hear occasionally: you can't control other peoples' actions; only your own. Emotional maturity, etc.

Re:If your code accepts URIs as input, filter out “file://” by toomanybeersies on Monday September 12, 2016 @10:07AM (#12479758)
Isn't that missing the point of the robustness principle, which is more related to say, networking, and accepting things that aren't strictly to RFC spec, but when sending things, you match the spec to the letter?
Re:If your code accepts URIs as input, filter out “file://” by artursapek on Monday September 12, 2016 @10:11AM (#12479788)
I've found it useful in software design in general.
Re:If your code accepts URIs as input, filter out “file://” by pdkl95 on Monday September 12, 2016 @07:37AM (#12478820)
Be liberal in a well-defined way in what you accept. Accepting a variety of input is fine, as long as it is formally defined and recognized. The robustness principle is not an excuse to be sloppy with the input.

(why? see [2] in my other post, "The Science of Insecurity")