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

Function isResourceUrlAllowedByPolicy

test/angular/1.7/angular.js:20177–20197  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

20175 }
20176
20177 function isResourceUrlAllowedByPolicy(url) {
20178 var parsedUrl = urlResolve(url.toString());
20179 var i, n, allowed = false;
20180 // Ensure that at least one item from the whitelist allows this url.
20181 for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {
20182 if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {
20183 allowed = true;
20184 break;
20185 }
20186 }
20187 if (allowed) {
20188 // Ensure that no item from the blacklist blocked this url.
20189 for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {
20190 if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {
20191 allowed = false;
20192 break;
20193 }
20194 }
20195 }
20196 return allowed;
20197 }
20198
20199 function generateHolderType(Base) {
20200 var holderType = function TrustedValueHolderType(trustedValue) {

Callers 1

getTrustedFunction · 0.70

Calls 2

urlResolveFunction · 0.70
matchUrlFunction · 0.70

Tested by

no test coverage detected