Skip to content

Commit f4a8c1d

Browse files
committed
1 parent 64489f3 commit f4a8c1d

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/vs/workbench/contrib/url/common/trustedDomainsValidator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ export function isURLDomainTrusted(url: URI, trustedDomains: string[]) {
158158
}
159159

160160
if (url.authority === parsedTrustedDomain.authority) {
161-
return pathMatches(url.path, parsedTrustedDomain.path);
161+
if (pathMatches(url.path, parsedTrustedDomain.path)) {
162+
return true;
163+
} else {
164+
continue;
165+
}
162166
}
163167

164168
if (trustedDomains[i].indexOf('*') !== -1) {

src/vs/workbench/test/contrib/linkProtection.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,7 @@ suite('Link protection domain matching', () => {
7070

7171
linkNotAllowedByRules('https://a.x.org/bar', ['https://*.x.org/foo']);
7272
linkNotAllowedByRules('https://a.b.x.org/bar', ['https://*.x.org/foo']);
73+
74+
linkAllowedByRules('https://github.com', ['https://github.com/foo/bar', 'https://github.com']);
7375
});
7476
});

0 commit comments

Comments
 (0)