Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plugins/core/tests/scope.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ describe('DomainFilter', () => {
const filter = new DomainFilter(['allowed.com']);
expect(filter.isAllowed('other.com')).toBe(false);
});

it('should fallback to raw string on invalid hostname', () => {
// '[' and 'http://denied-invalid-[' causes new URL() to throw
const filter = new DomainFilter(['['], ['denied-invalid-[']);
expect(filter.isAllowed('[')).toBe(true);
expect(filter.isAllowed('denied-invalid-[')).toBe(false);
});
});

describe('SubdomainPolicy', () => {
Expand Down
Loading