Skip to content

Commit

Permalink
Add reserved domain patterns to EXCEPTION_TOP_HOSTS list
Browse files Browse the repository at this point in the history
  • Loading branch information
wozitto committed Mar 10, 2024
1 parent 12691a2 commit 269c6cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/jsts/src/rules/S5332/rule.lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const EXCEPTION_FULL_HOSTS = [
'graphml.graphdrawing.org',
'json-schema.org',
];
const EXCEPTION_TOP_HOSTS = [/(.*\.)?example\.com$/, /(.*\.)?example\.org$/, /(.*\.)?test\.com$/];
const EXCEPTION_TOP_HOSTS = [/\.example$/, /(.*\.)?example\.com$/, /(.*\.)?example\.org$/, /\.test$/, /(.*\.)?test\.com$/];

export const rule: Rule.RuleModule = {
meta: {
Expand Down
4 changes: 4 additions & 0 deletions packages/jsts/src/rules/S5332/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ ruleTester.run('Using clear-text protocols is security-sensitive', rule, {
},
{
code: `
url = "http://example.example";
url = "http://subdomain.example.example";
url = "http://example.com";
url = "http://someSubdomain.example.com";
url = "http://example.org";
url = "http://someSubdomain.example.org";
url = "http://example.test";
url = "http://subdomain.example.test";
url = "http://test.com";
url = "http://someSubdomain.test.com";
`,
Expand Down

0 comments on commit 269c6cd

Please sign in to comment.