mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
Improve URL parsing (#411)
* Check hostname is valid in getDomain * fix linting * Update noop implementation * Fix tests * Fix tests
This commit is contained in:
@@ -33,6 +33,11 @@ describe('Utils Service', () => {
|
||||
expect(Utils.getDomain('https://localhost')).toBe('localhost');
|
||||
expect(Utils.getDomain('https://192.168.1.1')).toBe('192.168.1.1');
|
||||
});
|
||||
|
||||
it('should reject invalid hostnames', () => {
|
||||
expect(Utils.getDomain('https://mywebsite.com$.mywebsite.com')).toBeNull();
|
||||
expect(Utils.getDomain('https://mywebsite.com!.mywebsite.com')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('getHostname', () => {
|
||||
|
||||
Reference in New Issue
Block a user