From 63d27b1d25b831b2f167659293555c2c068ab341 Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 12 Apr 2016 08:48:24 -0400 Subject: [PATCH] this fixes #1559 --- src/js/uritools.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/uritools.js b/src/js/uritools.js index bffe447c0..11ef86a79 100644 --- a/src/js/uritools.js +++ b/src/js/uritools.js @@ -1,7 +1,7 @@ /******************************************************************************* - µBlock - a browser extension to block requests. - Copyright (C) 2014 Raymond Hill + uBlock Origin - a browser extension to block requests. + Copyright (C) 2014-2016 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ Home: https://github.com/gorhill/uBlock */ -/* global µBlock, publicSuffixList */ +/* global publicSuffixList */ /******************************************************************************* @@ -264,8 +264,10 @@ URI.hostnameFromURI = function(uri) { } } // http://en.wikipedia.org/wiki/FQDN + // Also: + // - https://github.com/gorhill/uBlock/issues/1559 var hostname = matches[1]; - if ( hostname.endsWith('.') ) { + while ( hostname.endsWith('.') ) { hostname = hostname.slice(0, -1); } return hostname.toLowerCase();