[openstreetmap/openstreetmap-website] Blacklist all Google imagery with one regex (#1267)

Paul Norman notifications at github.com
Sat Aug 13 23:45:45 UTC 2016


> I can see plenty of false positives

Every imagery_used tag it matches is a Google URL.

> , starting with any domain containing google that isn't a google domain, for example:
> 
>     http://test.google.compton.nu/vt?x=1&y=2&z=3

> would match if I've read things right.

No one has ever used a domain even remotely similar to that except for those accessing Google, and the same for endpoints named `vt` or `kh`.

> If we were happy to only match the domain before then why not stick with that but broaden the domain match?

Do you have a suggestion for a regex which will catch all the local Google sites?

The closest I can come is `.*\.google(apis)?(\..)?\...?/`. Do you think that's better?

> Why start trying to (badly) match the rest of the URL as well, which just means it will break every time google tweak their URLs... 

They've been using the vt endpoint since 2013. The domain part of the URL changes more often.

> I mean it already matches anything with three x, y or z parameters not just those with one of each.

I'm fine with it matching a URL with three of the same parameter.

The current patterns have theoretical false positives too. I believe in practice the new pattern will have no more false positives than the current ones.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1267#issuecomment-239647730
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20160813/f5b16df3/attachment-0001.html>


More information about the rails-dev mailing list