1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

The domain of data URLs should be null. (#59)

This commit is contained in:
jgfaust
2020-01-25 07:52:51 -05:00
committed by Kyle Spearrin
parent 7d8143b288
commit c91ab626c2
2 changed files with 8 additions and 0 deletions

View File

@@ -10,6 +10,10 @@ describe('Utils Service', () => {
expect(Utils.getDomain('bitwarden')).toBeNull();
});
it('should fail for data urls', () => {
expect(Utils.getDomain('data:image/jpeg;base64,AAA')).toBeNull();
});
it('should handle urls without protocol', () => {
expect(Utils.getDomain('bitwarden.com')).toBe('bitwarden.com');
expect(Utils.getDomain('wrong://bitwarden.com')).toBe('bitwarden.com');