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

Function isResourceUrlAllowedByPolicy

test/angular/1.4/angular.js:17103–17123  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

17101 }
17102
17103 function isResourceUrlAllowedByPolicy(url) {
17104 var parsedUrl = urlResolve(url.toString());
17105 var i, n, allowed = false;
17106 // Ensure that at least one item from the whitelist allows this url.
17107 for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {
17108 if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {
17109 allowed = true;
17110 break;
17111 }
17112 }
17113 if (allowed) {
17114 // Ensure that no item from the blacklist blocked this url.
17115 for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {
17116 if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {
17117 allowed = false;
17118 break;
17119 }
17120 }
17121 }
17122 return allowed;
17123 }
17124
17125 function generateHolderType(Base) {
17126 var holderType = function TrustedValueHolderType(trustedValue) {

Callers 1

getTrustedFunction · 0.70

Calls 2

urlResolveFunction · 0.70
matchUrlFunction · 0.70

Tested by

no test coverage detected