This commit is contained in:
gorhill 2016-04-12 08:48:24 -04:00
parent 91106a253a
commit 63d27b1d25
1 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************* /*******************************************************************************
µBlock - a browser extension to block requests. uBlock Origin - a browser extension to block requests.
Copyright (C) 2014 Raymond Hill Copyright (C) 2014-2016 Raymond Hill
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uBlock 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 // http://en.wikipedia.org/wiki/FQDN
// Also:
// - https://github.com/gorhill/uBlock/issues/1559
var hostname = matches[1]; var hostname = matches[1];
if ( hostname.endsWith('.') ) { while ( hostname.endsWith('.') ) {
hostname = hostname.slice(0, -1); hostname = hostname.slice(0, -1);
} }
return hostname.toLowerCase(); return hostname.toLowerCase();