File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -31,11 +31,15 @@ function pathToDomain(path, currentHost) {
3131 continue ;
3232 }
3333 var t = TldJS . parse ( parts [ key ] ) ;
34+
35+ // Part is considered to be a domain component in one of the following cases:
36+ // - it is a valid domain with well-known TLD (github.com, login.github.com)
37+ // - it is a valid domain with unknown TLD but the current host is it's subdomain (login.pi.hole)
38+ // - it is or isnt a valid domain but the current host matches it EXACTLY (localhost, pi.hole)
3439 if (
3540 t . isValid &&
36- ( ( t . tldExists && t . domain !== null ) ||
37- t . hostname === currentHost ||
38- currentHost . endsWith ( `.${ t . hostname } ` ) )
41+ ( ( t . domain !== null && ( t . tldExists || currentHost . endsWith ( `.${ t . hostname } ` ) ) ) ||
42+ currentHost === t . hostname )
3943 ) {
4044 return t . hostname ;
4145 }
You can’t perform that action at this time.
0 commit comments