Skip to content

Commit

Permalink
Add _ as a permitted parameter in the host
Browse files Browse the repository at this point in the history
  • Loading branch information
hiuxmaycry committed Apr 9, 2023
1 parent 66ca75a commit 1fc4d83
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.js
Expand Up @@ -17,7 +17,7 @@ module.exports = function (RE) {
'(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}';
var protocol = allowedProtocols === '*' ? '(?:(?:[a-z]+:)?//)?' : '(?:('+ allowedProtocols.join('|') +')://)?';
var auth = '(?:\\S+(?::\\S*)?@)?';
var host = '(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)';
var host = '(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9_]+)';
var domain =
'(?:\\.(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9_]+)*';
var tld = tldvalidation ? '(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))\\.?' : '';
Expand Down
1 change: 0 additions & 1 deletion test/notmatch.js
Expand Up @@ -31,7 +31,6 @@ const defaultOptsFixture = [
'http://.www.foo.bar/',
'http://.www.foo.bar./',
'http://go/ogle.com',
'https://_dev.envfoo',
'https://dev.envfoo_',
'https://dev.envfoo.bar_',
'http://foo.bar/ /',
Expand Down
2 changes: 2 additions & 0 deletions test/urlmatch.js
Expand Up @@ -58,10 +58,12 @@ const exactFixtures = [
'http://userid:password@example.com',
'http://➡.ws/䨹',
'www.google.com/unicorn',
'https://_dev.envfoo',
'https://dev_env.foo.bar',
'https://dev.env_foo.bar',
'https://dev.envfoo_.bar',
'https://dev._envfoo.bar',
'https://digital-id-api-ci-exchange_.apps.nonprod.tas.bdc.ca',
'http://example.com.',
'http://www.microsoft.xn--comindex-g03d.html.irongeek.com',
'www.microsoft.xn--comindex-g03d.html.irongeek.com',
Expand Down

0 comments on commit 1fc4d83

Please sign in to comment.