MCPcopy
hub / github.com/angular-ui/ui-grid / isResourceUrlAllowedByPolicy

Function isResourceUrlAllowedByPolicy

lib/test/angular/1.8.0/angular.js:20242–20262  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

20240 }
20241
20242 function isResourceUrlAllowedByPolicy(url) {
20243 var parsedUrl = urlResolve(url.toString());
20244 var i, n, allowed = false;
20245 // Ensure that at least one item from the whitelist allows this url.
20246 for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {
20247 if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {
20248 allowed = true;
20249 break;
20250 }
20251 }
20252 if (allowed) {
20253 // Ensure that no item from the blacklist blocked this url.
20254 for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {
20255 if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {
20256 allowed = false;
20257 break;
20258 }
20259 }
20260 }
20261 return allowed;
20262 }
20263
20264 function generateHolderType(Base) {
20265 var holderType = function TrustedValueHolderType(trustedValue) {

Callers 1

getTrustedFunction · 0.70

Calls 2

urlResolveFunction · 0.70
matchUrlFunction · 0.70

Tested by

no test coverage detected