@@ -151,30 +151,30 @@ describe('$compile', function() {
151151
152152 describe ( 'configuration' , function ( ) {
153153
154- it ( 'should use $$sanitizeUriProvider for reconfiguration of the `aHrefSanitizationWhitelist `' , function ( ) {
154+ it ( 'should use $$sanitizeUriProvider for reconfiguration of the `aHrefSanitizationTrustedUri `' , function ( ) {
155155 module ( function ( $compileProvider , $$sanitizeUriProvider ) {
156156 var newRe = / s a f e : / , returnVal ;
157157
158- expect ( $compileProvider . aHrefSanitizationWhitelist ( ) ) . toBe ( $$sanitizeUriProvider . aHrefSanitizationWhitelist ( ) ) ;
159- returnVal = $compileProvider . aHrefSanitizationWhitelist ( newRe ) ;
158+ expect ( $compileProvider . aHrefSanitizationTrustedUri ( ) ) . toBe ( $$sanitizeUriProvider . aHrefSanitizationTrustedUri ( ) ) ;
159+ returnVal = $compileProvider . aHrefSanitizationTrustedUri ( newRe ) ;
160160 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 ) ;
163163 } ) ;
164164 inject ( function ( ) {
165165 // needed to the module definition above is run...
166166 } ) ;
167167 } ) ;
168168
169- it ( 'should use $$sanitizeUriProvider for reconfiguration of the `imgSrcSanitizationWhitelist `' , function ( ) {
169+ it ( 'should use $$sanitizeUriProvider for reconfiguration of the `imgSrcSanitizationTrustedUri `' , function ( ) {
170170 module ( function ( $compileProvider , $$sanitizeUriProvider ) {
171171 var newRe = / s a f e : / , returnVal ;
172172
173- expect ( $compileProvider . imgSrcSanitizationWhitelist ( ) ) . toBe ( $$sanitizeUriProvider . imgSrcSanitizationWhitelist ( ) ) ;
174- returnVal = $compileProvider . imgSrcSanitizationWhitelist ( newRe ) ;
173+ expect ( $compileProvider . imgSrcSanitizationTrustedUri ( ) ) . toBe ( $$sanitizeUriProvider . imgSrcSanitizationTrustedUri ( ) ) ;
174+ returnVal = $compileProvider . imgSrcSanitizationTrustedUri ( newRe ) ;
175175 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 ) ;
178178 } ) ;
179179 inject ( function ( ) {
180180 // needed to the module definition above is run...
@@ -11334,9 +11334,9 @@ describe('$compile', function() {
1133411334 // IE9 rejects the `video` / `audio` tags with "Error: Not implemented"
1133511335 if ( msie !== 9 || tag === 'img' ) {
1133611336 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 ) {
1133811338 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
1134011340 $rootScope . $digest ( ) ;
1134111341 expect ( element . attr ( 'src' ) ) . toEqual ( 'http://example.com/image.mp4' ) ;
1134211342 } ) ) ;
@@ -11372,9 +11372,9 @@ describe('$compile', function() {
1137211372 if ( msie !== 9 ) {
1137311373 [ 'source' , 'track' ] . forEach ( function ( tag ) {
1137411374 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 ) {
1137611376 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
1137811378 $rootScope . $digest ( ) ;
1137911379 expect ( element . find ( tag ) . attr ( 'src' ) ) . toEqual ( 'http://example.com/image.mp4' ) ;
1138011380 } ) ) ;
@@ -11509,14 +11509,14 @@ describe('$compile', function() {
1150911509 } ) ;
1151011510 } ) ;
1151111511
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 ) {
1151311513 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
1151511515 $rootScope . $digest ( ) ;
1151611516 expect ( element . attr ( 'srcset' ) ) . toEqual ( 'http://example.com/image.png' ) ;
1151711517 } ) ) ;
1151811518
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 ) {
1152011520 element = $compile ( '<img srcset="{{testUrl}}"></img>' ) ( $rootScope ) ;
1152111521 $rootScope . testUrl = $sce . trustAsUrl ( 'http://example.com' ) ;
1152211522 $rootScope . $digest ( ) ;
@@ -11602,8 +11602,8 @@ describe('$compile', function() {
1160211602 } ) ;
1160311603
1160411604 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
1160711607 element = $compile ( '<a href="{{testUrl}}"></a>' ) ( $rootScope ) ;
1160811608 $rootScope . $digest ( ) ;
1160911609 expect ( element . attr ( 'href' ) ) . toEqual ( 'http://example.com/image.png' ) ;
@@ -11613,8 +11613,8 @@ describe('$compile', function() {
1161311613 expect ( element . attr ( 'ng-href' ) ) . toEqual ( 'http://example.com/image.png' ) ;
1161411614 } ) ) ;
1161511615
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
1161811618 element = $compile ( '<a href="{{testUrl}}"></a>' ) ( $rootScope ) ;
1161911619 $rootScope . $digest ( ) ;
1162011620 expect ( element . attr ( 'href' ) ) . toEqual ( 'javascript:foo()' ) ;
@@ -11624,8 +11624,8 @@ describe('$compile', function() {
1162411624 expect ( element . attr ( 'ng-href' ) ) . toEqual ( 'javascript:foo()' ) ;
1162511625 } ) ) ;
1162611626
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
1162911629 element = $compile ( '<a href="{{testUrl}}"></a>' ) ( $rootScope ) ;
1163011630 $rootScope . $digest ( ) ;
1163111631 expect ( element . attr ( 'href' ) ) . toEqual ( 'unsafe:javascript:foo()' ) ;
@@ -11678,7 +11678,7 @@ describe('$compile', function() {
1167811678 $provide . value ( '$$sanitizeUri' , $$sanitizeUri ) ;
1167911679 } ) ;
1168011680 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
1168211682 // because these interpolations will be resolved against the URL context instead
1168311683 $rootScope . testUrl = 'https://bad.example.org' ;
1168411684
@@ -11700,7 +11700,7 @@ describe('$compile', function() {
1170011700 $provide . value ( '$$sanitizeUri' , $$sanitizeUri ) ;
1170111701 } ) ;
1170211702 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
1170411704 // because these interpolations will be resolved against the URL context instead
1170511705 $rootScope . testUrl = 'https://bad.example.org' ;
1170611706
0 commit comments