This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 972
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix homepage punycode display bypass
fix #11001 Test Plan: 1. automated tests for homepage should pass 2. try setting your homepage to `ebаy.com/` 3. it should display the punycode
- Loading branch information
1 parent
560f997
commit 9c27818
Showing
3 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,9 +280,12 @@ describe('urlutil', function () { | |
}) | ||
|
||
describe('getPunycodeUrl', function () { | ||
it('returns empty string if input is not a URL', function () { | ||
it('returns original string if input is ASCII', function () { | ||
assert.equal(urlUtil.getPunycodeUrl('invalid-url-goes-here'), 'invalid-url-goes-here') | ||
}) | ||
it('returns punycode ASCII string if input is non-ASCII', function () { | ||
assert.equal(urlUtil.getPunycodeUrl('ebаy.com'), 'xn--eby-7cd.com') | ||
}) | ||
it('returns the punycode URL when given a valid URL', function () { | ||
assert.equal(urlUtil.getPunycodeUrl('http://brave:brave@ebаy.com:1234/brave#brave'), 'http://brave:[email protected]:1234/brave#brave') | ||
}) | ||
|