mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-17 11:11:05 +00:00
docs(minErr): rename sce/isecrurl to sce/insecurl
This commit is contained in:
parent
3ab579a2a6
commit
0bf0570505
7 changed files with 18 additions and 18 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
@ngdoc error
|
@ngdoc error
|
||||||
@name $sce:isecrurl
|
@name $sce:insecurl
|
||||||
@fullName Blocked loading an untrusted resource
|
@fullName Blocked loading an untrusted resource
|
||||||
@description
|
@description
|
||||||
|
|
||||||
|
|
@ -301,7 +301,7 @@ function $SceDelegateProvider() {
|
||||||
if (isResourceUrlAllowedByPolicy(maybeTrusted)) {
|
if (isResourceUrlAllowedByPolicy(maybeTrusted)) {
|
||||||
return maybeTrusted;
|
return maybeTrusted;
|
||||||
} else {
|
} else {
|
||||||
throw $sceMinErr('isecrurl',
|
throw $sceMinErr('insecurl',
|
||||||
'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}', maybeTrusted.toString());
|
'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}', maybeTrusted.toString());
|
||||||
}
|
}
|
||||||
} else if (type === SCE_CONTEXTS.HTML) {
|
} else if (type === SCE_CONTEXTS.HTML) {
|
||||||
|
|
|
||||||
|
|
@ -748,7 +748,7 @@ describe('$compile', function() {
|
||||||
expect(function() {
|
expect(function() {
|
||||||
$templateCache.put('http://example.com/should-not-load.html', 'Should not load even if in cache.');
|
$templateCache.put('http://example.com/should-not-load.html', 'Should not load even if in cache.');
|
||||||
$compile('<div class="crossDomainTemplate"></div>')($rootScope);
|
$compile('<div class="crossDomainTemplate"></div>')($rootScope);
|
||||||
}).toThrow('[$sce:isecrurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: http://example.com/should-not-load.html');
|
}).toThrow('[$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: http://example.com/should-not-load.html');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should load cross domain templates when trusted', inject(
|
it('should load cross domain templates when trusted', inject(
|
||||||
|
|
@ -3063,7 +3063,7 @@ describe('$compile', function() {
|
||||||
element = $compile('<iframe src="{{testUrl}}"></iframe>')($rootScope);
|
element = $compile('<iframe src="{{testUrl}}"></iframe>')($rootScope);
|
||||||
$rootScope.testUrl = "http://a.different.domain.example.com";
|
$rootScope.testUrl = "http://a.different.domain.example.com";
|
||||||
expect(function() { $rootScope.$apply() }).toThrow(
|
expect(function() { $rootScope.$apply() }).toThrow(
|
||||||
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:isecrurl] Blocked " +
|
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
|
||||||
"loading resource from url not allowed by $sceDelegate policy. URL: " +
|
"loading resource from url not allowed by $sceDelegate policy. URL: " +
|
||||||
"http://a.different.domain.example.com");
|
"http://a.different.domain.example.com");
|
||||||
}));
|
}));
|
||||||
|
|
@ -3072,7 +3072,7 @@ describe('$compile', function() {
|
||||||
element = $compile('<iframe src="{{testUrl}}"></iframe>')($rootScope);
|
element = $compile('<iframe src="{{testUrl}}"></iframe>')($rootScope);
|
||||||
$rootScope.testUrl = "javascript:alert(1);";
|
$rootScope.testUrl = "javascript:alert(1);";
|
||||||
expect(function() { $rootScope.$apply() }).toThrow(
|
expect(function() { $rootScope.$apply() }).toThrow(
|
||||||
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:isecrurl] Blocked " +
|
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
|
||||||
"loading resource from url not allowed by $sceDelegate policy. URL: " +
|
"loading resource from url not allowed by $sceDelegate policy. URL: " +
|
||||||
"javascript:alert(1);");
|
"javascript:alert(1);");
|
||||||
}));
|
}));
|
||||||
|
|
@ -3081,7 +3081,7 @@ describe('$compile', function() {
|
||||||
element = $compile('<iframe src="{{testUrl}}"></iframe>')($rootScope);
|
element = $compile('<iframe src="{{testUrl}}"></iframe>')($rootScope);
|
||||||
$rootScope.testUrl = $sce.trustAsUrl("javascript:doTrustedStuff()");
|
$rootScope.testUrl = $sce.trustAsUrl("javascript:doTrustedStuff()");
|
||||||
expect($rootScope.$apply).toThrow(
|
expect($rootScope.$apply).toThrow(
|
||||||
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:isecrurl] Blocked " +
|
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
|
||||||
"loading resource from url not allowed by $sceDelegate policy. URL: javascript:doTrustedStuff()");
|
"loading resource from url not allowed by $sceDelegate policy. URL: javascript:doTrustedStuff()");
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ describe('ngSrc', function() {
|
||||||
});
|
});
|
||||||
element.attr('src');
|
element.attr('src');
|
||||||
}).toThrow(
|
}).toThrow(
|
||||||
"[$interpolate:interr] Can't interpolate: {{id}}\nError: [$sce:isecrurl] Blocked " +
|
"[$interpolate:interr] Can't interpolate: {{id}}\nError: [$sce:insecurl] Blocked " +
|
||||||
"loading resource from url not allowed by $sceDelegate policy. URL: http://somewhere");
|
"loading resource from url not allowed by $sceDelegate policy. URL: http://somewhere");
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ describe('ngSrc', function() {
|
||||||
element = $compile('<iframe ng-src="{{testUrl}}"></iframe>')($rootScope);
|
element = $compile('<iframe ng-src="{{testUrl}}"></iframe>')($rootScope);
|
||||||
$rootScope.testUrl = "http://a.different.domain.example.com";
|
$rootScope.testUrl = "http://a.different.domain.example.com";
|
||||||
expect(function() { $rootScope.$apply() }).toThrow(
|
expect(function() { $rootScope.$apply() }).toThrow(
|
||||||
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:isecrurl] Blocked " +
|
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
|
||||||
"loading resource from url not allowed by $sceDelegate policy. URL: " +
|
"loading resource from url not allowed by $sceDelegate policy. URL: " +
|
||||||
"http://a.different.domain.example.com");
|
"http://a.different.domain.example.com");
|
||||||
}));
|
}));
|
||||||
|
|
@ -36,7 +36,7 @@ describe('ngSrc', function() {
|
||||||
element = $compile('<iframe ng-src="{{testUrl}}"></iframe>')($rootScope);
|
element = $compile('<iframe ng-src="{{testUrl}}"></iframe>')($rootScope);
|
||||||
$rootScope.testUrl = "javascript:alert(1);";
|
$rootScope.testUrl = "javascript:alert(1);";
|
||||||
expect(function() { $rootScope.$apply() }).toThrow(
|
expect(function() { $rootScope.$apply() }).toThrow(
|
||||||
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:isecrurl] Blocked " +
|
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
|
||||||
"loading resource from url not allowed by $sceDelegate policy. URL: " +
|
"loading resource from url not allowed by $sceDelegate policy. URL: " +
|
||||||
"javascript:alert(1);");
|
"javascript:alert(1);");
|
||||||
}));
|
}));
|
||||||
|
|
@ -45,7 +45,7 @@ describe('ngSrc', function() {
|
||||||
element = $compile('<iframe ng-src="{{testUrl}}"></iframe>')($rootScope);
|
element = $compile('<iframe ng-src="{{testUrl}}"></iframe>')($rootScope);
|
||||||
$rootScope.testUrl = $sce.trustAsUrl("javascript:doTrustedStuff()");
|
$rootScope.testUrl = $sce.trustAsUrl("javascript:doTrustedStuff()");
|
||||||
expect($rootScope.$apply).toThrow(
|
expect($rootScope.$apply).toThrow(
|
||||||
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:isecrurl] Blocked " +
|
"[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
|
||||||
"loading resource from url not allowed by $sceDelegate policy. URL: " +
|
"loading resource from url not allowed by $sceDelegate policy. URL: " +
|
||||||
"javascript:doTrustedStuff()");
|
"javascript:doTrustedStuff()");
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ describe('SCE', function() {
|
||||||
blackList: []
|
blackList: []
|
||||||
}, function($sce) {
|
}, function($sce) {
|
||||||
expect(function() { $sce.getTrustedResourceUrl('#'); }).toThrow(
|
expect(function() { $sce.getTrustedResourceUrl('#'); }).toThrow(
|
||||||
'[$sce:isecrurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: #');
|
'[$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: #');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should match against normalized urls', runTest(
|
it('should match against normalized urls', runTest(
|
||||||
|
|
@ -289,7 +289,7 @@ describe('SCE', function() {
|
||||||
blackList: []
|
blackList: []
|
||||||
}, function($sce) {
|
}, function($sce) {
|
||||||
expect(function() { $sce.getTrustedResourceUrl('foo'); }).toThrow(
|
expect(function() { $sce.getTrustedResourceUrl('foo'); }).toThrow(
|
||||||
'[$sce:isecrurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: foo');
|
'[$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: foo');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should support custom regex', runTest(
|
it('should support custom regex', runTest(
|
||||||
|
|
@ -299,7 +299,7 @@ describe('SCE', function() {
|
||||||
}, function($sce) {
|
}, function($sce) {
|
||||||
expect($sce.getTrustedResourceUrl('http://example.com/foo')).toEqual('http://example.com/foo');
|
expect($sce.getTrustedResourceUrl('http://example.com/foo')).toEqual('http://example.com/foo');
|
||||||
expect(function() { $sce.getTrustedResourceUrl('https://example.com/foo'); }).toThrow(
|
expect(function() { $sce.getTrustedResourceUrl('https://example.com/foo'); }).toThrow(
|
||||||
'[$sce:isecrurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: https://example.com/foo');
|
'[$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: https://example.com/foo');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should support the special string "self" in whitelist', runTest(
|
it('should support the special string "self" in whitelist', runTest(
|
||||||
|
|
@ -316,7 +316,7 @@ describe('SCE', function() {
|
||||||
blackList: ['self']
|
blackList: ['self']
|
||||||
}, function($sce) {
|
}, function($sce) {
|
||||||
expect(function() { $sce.getTrustedResourceUrl('foo'); }).toThrow(
|
expect(function() { $sce.getTrustedResourceUrl('foo'); }).toThrow(
|
||||||
'[$sce:isecrurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: foo');
|
'[$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: foo');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should have blacklist override the whitelist', runTest(
|
it('should have blacklist override the whitelist', runTest(
|
||||||
|
|
@ -325,7 +325,7 @@ describe('SCE', function() {
|
||||||
blackList: ['self']
|
blackList: ['self']
|
||||||
}, function($sce) {
|
}, function($sce) {
|
||||||
expect(function() { $sce.getTrustedResourceUrl('foo'); }).toThrow(
|
expect(function() { $sce.getTrustedResourceUrl('foo'); }).toThrow(
|
||||||
'[$sce:isecrurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: foo');
|
'[$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: foo');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should support multiple items in both lists', runTest(
|
it('should support multiple items in both lists', runTest(
|
||||||
|
|
@ -337,9 +337,9 @@ describe('SCE', function() {
|
||||||
expect($sce.getTrustedResourceUrl('http://example.com/1')).toEqual('http://example.com/1');
|
expect($sce.getTrustedResourceUrl('http://example.com/1')).toEqual('http://example.com/1');
|
||||||
expect($sce.getTrustedResourceUrl('http://example.com/2')).toEqual('http://example.com/2');
|
expect($sce.getTrustedResourceUrl('http://example.com/2')).toEqual('http://example.com/2');
|
||||||
expect(function() { $sce.getTrustedResourceUrl('http://example.com/3'); }).toThrow(
|
expect(function() { $sce.getTrustedResourceUrl('http://example.com/3'); }).toThrow(
|
||||||
'[$sce:isecrurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: http://example.com/3');
|
'[$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: http://example.com/3');
|
||||||
expect(function() { $sce.getTrustedResourceUrl('open_redirect'); }).toThrow(
|
expect(function() { $sce.getTrustedResourceUrl('open_redirect'); }).toThrow(
|
||||||
'[$sce:isecrurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: open_redirect');
|
'[$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: open_redirect');
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -520,7 +520,7 @@ describe('$route', function() {
|
||||||
$location.path('/foo');
|
$location.path('/foo');
|
||||||
expect(function() {
|
expect(function() {
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
}).toThrow('[$sce:isecrurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: http://example.com/foo.html');
|
}).toThrow('[$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: http://example.com/foo.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue