@@ -151,30 +151,30 @@ describe('$compile', function() {
151
151
152
152
describe ( 'configuration' , function ( ) {
153
153
154
- it ( 'should use $$sanitizeUriProvider for reconfiguration of the `aHrefSanitizationWhitelist `' , function ( ) {
154
+ it ( 'should use $$sanitizeUriProvider for reconfiguration of the `aHrefSanitizationTrustedUri `' , function ( ) {
155
155
module ( function ( $compileProvider , $$sanitizeUriProvider ) {
156
156
var newRe = / s a f e : / , returnVal ;
157
157
158
- expect ( $compileProvider . aHrefSanitizationWhitelist ( ) ) . toBe ( $$sanitizeUriProvider . aHrefSanitizationWhitelist ( ) ) ;
159
- returnVal = $compileProvider . aHrefSanitizationWhitelist ( newRe ) ;
158
+ expect ( $compileProvider . aHrefSanitizationTrustedUri ( ) ) . toBe ( $$sanitizeUriProvider . aHrefSanitizationTrustedUri ( ) ) ;
159
+ returnVal = $compileProvider . aHrefSanitizationTrustedUri ( newRe ) ;
160
160
expect ( returnVal ) . toBe ( $compileProvider ) ;
161
- expect ( $$sanitizeUriProvider . aHrefSanitizationWhitelist ( ) ) . toBe ( newRe ) ;
162
- expect ( $compileProvider . aHrefSanitizationWhitelist ( ) ) . toBe ( newRe ) ;
161
+ expect ( $$sanitizeUriProvider . aHrefSanitizationTrustedUri ( ) ) . toBe ( newRe ) ;
162
+ expect ( $compileProvider . aHrefSanitizationTrustedUri ( ) ) . toBe ( newRe ) ;
163
163
} ) ;
164
164
inject ( function ( ) {
165
165
// needed to the module definition above is run...
166
166
} ) ;
167
167
} ) ;
168
168
169
- it ( 'should use $$sanitizeUriProvider for reconfiguration of the `imgSrcSanitizationWhitelist `' , function ( ) {
169
+ it ( 'should use $$sanitizeUriProvider for reconfiguration of the `imgSrcSanitizationTrustedUri `' , function ( ) {
170
170
module ( function ( $compileProvider , $$sanitizeUriProvider ) {
171
171
var newRe = / s a f e : / , returnVal ;
172
172
173
- expect ( $compileProvider . imgSrcSanitizationWhitelist ( ) ) . toBe ( $$sanitizeUriProvider . imgSrcSanitizationWhitelist ( ) ) ;
174
- returnVal = $compileProvider . imgSrcSanitizationWhitelist ( newRe ) ;
173
+ expect ( $compileProvider . imgSrcSanitizationTrustedUri ( ) ) . toBe ( $$sanitizeUriProvider . imgSrcSanitizationTrustedUri ( ) ) ;
174
+ returnVal = $compileProvider . imgSrcSanitizationTrustedUri ( newRe ) ;
175
175
expect ( returnVal ) . toBe ( $compileProvider ) ;
176
- expect ( $$sanitizeUriProvider . imgSrcSanitizationWhitelist ( ) ) . toBe ( newRe ) ;
177
- expect ( $compileProvider . imgSrcSanitizationWhitelist ( ) ) . toBe ( newRe ) ;
176
+ expect ( $$sanitizeUriProvider . imgSrcSanitizationTrustedUri ( ) ) . toBe ( newRe ) ;
177
+ expect ( $compileProvider . imgSrcSanitizationTrustedUri ( ) ) . toBe ( newRe ) ;
178
178
} ) ;
179
179
inject ( function ( ) {
180
180
// needed to the module definition above is run...
@@ -11334,9 +11334,9 @@ describe('$compile', function() {
11334
11334
// IE9 rejects the `video` / `audio` tags with "Error: Not implemented"
11335
11335
if ( msie !== 9 || tag === 'img' ) {
11336
11336
describe ( tag + '[src] context requirement' , function ( ) {
11337
- it ( 'should NOT require trusted values for whitelisted URIs' , inject ( function ( $rootScope , $compile ) {
11337
+ it ( 'should NOT require trusted values for trusted URIs' , inject ( function ( $rootScope , $compile ) {
11338
11338
element = $compile ( '<' + tag + ' src="{{testUrl}}"></' + tag + '>' ) ( $rootScope ) ;
11339
- $rootScope . testUrl = 'http://example.com/image.mp4' ; // `http` is whitelisted
11339
+ $rootScope . testUrl = 'http://example.com/image.mp4' ; // `http` is trusted
11340
11340
$rootScope . $digest ( ) ;
11341
11341
expect ( element . attr ( 'src' ) ) . toEqual ( 'http://example.com/image.mp4' ) ;
11342
11342
} ) ) ;
@@ -11372,9 +11372,9 @@ describe('$compile', function() {
11372
11372
if ( msie !== 9 ) {
11373
11373
[ 'source' , 'track' ] . forEach ( function ( tag ) {
11374
11374
describe ( tag + '[src]' , function ( ) {
11375
- it ( 'should NOT require trusted values for whitelisted URIs' , inject ( function ( $rootScope , $compile ) {
11375
+ it ( 'should NOT require trusted values for trusted URIs' , inject ( function ( $rootScope , $compile ) {
11376
11376
element = $compile ( '<video><' + tag + ' src="{{testUrl}}"></' + tag + '></video>' ) ( $rootScope ) ;
11377
- $rootScope . testUrl = 'http://example.com/image.mp4' ; // `http` is whitelisted
11377
+ $rootScope . testUrl = 'http://example.com/image.mp4' ; // `http` is trusted
11378
11378
$rootScope . $digest ( ) ;
11379
11379
expect ( element . find ( tag ) . attr ( 'src' ) ) . toEqual ( 'http://example.com/image.mp4' ) ;
11380
11380
} ) ) ;
@@ -11509,14 +11509,14 @@ describe('$compile', function() {
11509
11509
} ) ;
11510
11510
} ) ;
11511
11511
11512
- it ( 'should NOT require trusted values for whitelisted values' , inject ( function ( $rootScope , $compile , $sce ) {
11512
+ it ( 'should NOT require trusted values for trusted URI values' , inject ( function ( $rootScope , $compile , $sce ) {
11513
11513
element = $compile ( '<img srcset="{{testUrl}}"></img>' ) ( $rootScope ) ;
11514
- $rootScope . testUrl = 'http://example.com/image.png' ; // `http` is whitelisted
11514
+ $rootScope . testUrl = 'http://example.com/image.png' ; // `http` is trusted
11515
11515
$rootScope . $digest ( ) ;
11516
11516
expect ( element . attr ( 'srcset' ) ) . toEqual ( 'http://example.com/image.png' ) ;
11517
11517
} ) ) ;
11518
11518
11519
- it ( 'should accept trusted values, if they are also whitelisted ' , inject ( function ( $rootScope , $compile , $sce ) {
11519
+ it ( 'should accept trusted values, if they are also trusted URIs ' , inject ( function ( $rootScope , $compile , $sce ) {
11520
11520
element = $compile ( '<img srcset="{{testUrl}}"></img>' ) ( $rootScope ) ;
11521
11521
$rootScope . testUrl = $sce . trustAsUrl ( 'http://example.com' ) ;
11522
11522
$rootScope . $digest ( ) ;
@@ -11602,8 +11602,8 @@ describe('$compile', function() {
11602
11602
} ) ;
11603
11603
11604
11604
describe ( 'a[href] sanitization' , function ( ) {
11605
- it ( 'should NOT require trusted values for whitelisted values' , inject ( function ( $rootScope , $compile ) {
11606
- $rootScope . testUrl = 'http://example.com/image.png' ; // `http` is whitelisted
11605
+ it ( 'should NOT require trusted values for trusted URI values' , inject ( function ( $rootScope , $compile ) {
11606
+ $rootScope . testUrl = 'http://example.com/image.png' ; // `http` is trusted
11607
11607
element = $compile ( '<a href="{{testUrl}}"></a>' ) ( $rootScope ) ;
11608
11608
$rootScope . $digest ( ) ;
11609
11609
expect ( element . attr ( 'href' ) ) . toEqual ( 'http://example.com/image.png' ) ;
@@ -11613,8 +11613,8 @@ describe('$compile', function() {
11613
11613
expect ( element . attr ( 'ng-href' ) ) . toEqual ( 'http://example.com/image.png' ) ;
11614
11614
} ) ) ;
11615
11615
11616
- it ( 'should accept trusted values for non-whitelisted values' , inject ( function ( $rootScope , $compile , $sce ) {
11617
- $rootScope . testUrl = $sce . trustAsUrl ( 'javascript:foo()' ) ; // `javascript` is not whitelisted
11616
+ it ( 'should accept trusted values for non-trusted URI values' , inject ( function ( $rootScope , $compile , $sce ) {
11617
+ $rootScope . testUrl = $sce . trustAsUrl ( 'javascript:foo()' ) ; // `javascript` is not trusted
11618
11618
element = $compile ( '<a href="{{testUrl}}"></a>' ) ( $rootScope ) ;
11619
11619
$rootScope . $digest ( ) ;
11620
11620
expect ( element . attr ( 'href' ) ) . toEqual ( 'javascript:foo()' ) ;
@@ -11624,8 +11624,8 @@ describe('$compile', function() {
11624
11624
expect ( element . attr ( 'ng-href' ) ) . toEqual ( 'javascript:foo()' ) ;
11625
11625
} ) ) ;
11626
11626
11627
- it ( 'should sanitize non-whitelisted values' , inject ( function ( $rootScope , $compile ) {
11628
- $rootScope . testUrl = 'javascript:foo()' ; // `javascript` is not whitelisted
11627
+ it ( 'should sanitize non-trusted values' , inject ( function ( $rootScope , $compile ) {
11628
+ $rootScope . testUrl = 'javascript:foo()' ; // `javascript` is not trusted
11629
11629
element = $compile ( '<a href="{{testUrl}}"></a>' ) ( $rootScope ) ;
11630
11630
$rootScope . $digest ( ) ;
11631
11631
expect ( element . attr ( 'href' ) ) . toEqual ( 'unsafe:javascript:foo()' ) ;
@@ -11678,7 +11678,7 @@ describe('$compile', function() {
11678
11678
$provide . value ( '$$sanitizeUri' , $$sanitizeUri ) ;
11679
11679
} ) ;
11680
11680
inject ( function ( $compile , $rootScope ) {
11681
- // This URL would fail the RESOURCE_URL whitelist , but that test shouldn't be run
11681
+ // This URL would fail the RESOURCE_URL trusted list , but that test shouldn't be run
11682
11682
// because these interpolations will be resolved against the URL context instead
11683
11683
$rootScope . testUrl = 'https://bad.example.org' ;
11684
11684
@@ -11700,7 +11700,7 @@ describe('$compile', function() {
11700
11700
$provide . value ( '$$sanitizeUri' , $$sanitizeUri ) ;
11701
11701
} ) ;
11702
11702
inject ( function ( $compile , $rootScope ) {
11703
- // This URL would fail the RESOURCE_URL whitelist , but that test shouldn't be run
11703
+ // This URL would fail the RESOURCE_URL trusted list , but that test shouldn't be run
11704
11704
// because these interpolations will be resolved against the URL context instead
11705
11705
$rootScope . testUrl = 'https://bad.example.org' ;
11706
11706
0 commit comments