Skip to content

Commit

Permalink
Fix look-up of specific-generic filters entity-less hostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Dec 14, 2020
1 parent c45b93a commit b22cf24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 8 additions & 6 deletions src/js/html-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,14 @@
hostname,
[ plains, exceptions, procedurals, exceptions ]
);
if ( details.entity !== '' ) {
filterDB.retrieve(
`${hostname.slice(0, -details.domain.length)}${details.entity}`,
[ plains, exceptions, procedurals, exceptions ]
);
}
const entity = details.entity !== ''
? `${hostname.slice(0, -details.domain.length)}${details.entity}`
: '*';
filterDB.retrieve(
entity,
[ plains, exceptions, procedurals, exceptions ],
1
);

if ( plains.size === 0 && procedurals.size === 0 ) { return; }

Expand Down
10 changes: 4 additions & 6 deletions src/js/scriptlet-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,10 @@
sessionScriptletDB.retrieve([ null, $exceptions ]);
}
scriptletDB.retrieve(hostname, [ $scriptlets, $exceptions ]);
if ( request.entity !== '' ) {
scriptletDB.retrieve(
`${hostname.slice(0, -request.domain.length)}${request.entity}`,
[ $scriptlets, $exceptions ]
);
}
const entity = request.entity !== ''
? `${hostname.slice(0, -request.domain.length)}${request.entity}`
: '*';
scriptletDB.retrieve(entity, [ $scriptlets, $exceptions ], 1);
if ( $scriptlets.size === 0 ) { return; }

const loggerEnabled = µb.logger.enabled;
Expand Down

0 comments on commit b22cf24

Please sign in to comment.