MCPcopy Create free account
hub / github.com/angular-ui/ui-grid / isResourceUrlAllowedByPolicy

Function isResourceUrlAllowedByPolicy

lib/test/angular/1.4.3/angular.js:16544–16564  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

16542 }
16543
16544 function isResourceUrlAllowedByPolicy(url) {
16545 var parsedUrl = urlResolve(url.toString());
16546 var i, n, allowed = false;
16547 // Ensure that at least one item from the whitelist allows this url.
16548 for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {
16549 if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {
16550 allowed = true;
16551 break;
16552 }
16553 }
16554 if (allowed) {
16555 // Ensure that no item from the blacklist blocked this url.
16556 for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {
16557 if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {
16558 allowed = false;
16559 break;
16560 }
16561 }
16562 }
16563 return allowed;
16564 }
16565
16566 function generateHolderType(Base) {
16567 var holderType = function TrustedValueHolderType(trustedValue) {

Callers 1

getTrustedFunction · 0.70

Calls 2

urlResolveFunction · 0.70
matchUrlFunction · 0.70

Tested by

no test coverage detected