5 ms·
Ok i need a whitelist of every url but ones that start with facebook ... go
by iteriteratedone 9y ago
Ok i need a whitelist of every url but ones that start with facebook ... go
- jeremiep 9y agoIts not a whitelist of domains, but of applications allowed to use the agent. Right now Blizzard is blacklisting only the browsers from using it, but that still leaves a bunch of other things like slack and whatnot. Its indeed a very strange patch from Blizzard. As if they hastily assigned an intern to it and then called it a day.
- hug 9y agoIn case you think this is hard: ^(?!facebook).*
- jdoliner 9y agoThis is a blacklist though.
- Nadya 9y agoFunctionally - yes. By definition - no. A blacklist won't allow items that match and a whitelist only allows items that match. Blacklists include by default and whitelists exclude by default. Since the regex needs to match to be included - it is, by definition, a whitelist. It excludes by default anything that doesn't match. It just so happens the net being cast is so wide as to be "all except ____" where a whitelist is usually seen as "none except ____".
- jdoliner 9y agoI think part of the definition blacklist and whitelist is being a list.
- Nadya 9y agoThink of it as shorthand for a list that expands to be infinitely large. [0] People would consider a blacklist that includes ` * .example.com` to be a list that contains all potential subdomains of `example.com`. With ` * ` being seen as shorthand. E: Spaces around the asterisk added to avoid HN formatting. [0] Technical limitations aside, especially in the context of URL matching since URLs have a maximum character length.
- eropple 9y agoA list of regexes is a list. A list with one entry is also a list.
- anyfoo 9y agoThat's not really a whitelist though.
- iteriteratedone 9y agoIs that not a black list? ... you are not affirming equality ... you are affirming inequality
- hug 9y agoHow do you define a whitelist? A list of items, that, if matched, are allowed? That regex will only positively "match" non-facebook items, and will only block facebook if implemented in a whitelist. I'm just playing the straight man to your joke. Of course it's functionally a blacklist: That's what you asked for.
- iteriteratedone 9y agoSorry cant drop this one yet My comment is not a joke but a challenge to the parent ... that they are wrong Yes whitelist are safer ... but whitelists can be cumbersome to generate/maintain and slow you down at runtime ... On reddit let this slide , but here we have to correct the flawed thinking. You cant run from engineering problems without consequece So now we have graduated to course 202: how to make a blacklist safe? Check context, and restrict access
- Nadya 9y ago>Check context, and restrict access But then why do you need the blacklist? I refer to this post by vec: https://news.ycombinator.com/item?id=16208419 https://news.ycombinator.com/item?id=16208419 If you think you need a blacklist you should probably be using a whitelist. If your problem can't be solved with a whitelist then it's probably better solved in a way that doesn't involve a blacklist or a whitelist.
- hug 9y agoIf it's not a joke, it's at least an exercise in absurdity. I wrote a regex that would allow things that aren't facebook, and then you said "No, you're not allowing things that aren't facebook, you're not allowing things that don't match not being facebook". If it's not a white-list, it's at least an opposite-of-black-list.
- foota 9y agocat urls | grep -v ^facebook.* ftfy
- syntheticnature 9y ago...did you intend to allow fbcdn.net (a Facebook-controlled domain)?