1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 15:32:28 +02:00
This commit is contained in:
gorhill 2016-04-12 08:48:24 -04:00
parent 91106a253a
commit 63d27b1d25

View File

@ -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();