@@ -37,13 +37,6 @@ describe('sanitizeUri', function() {
37
37
expect ( sanitizeImg ( testUrl ) ) . toBe ( "unsafe:data:,foo" ) ;
38
38
} ) ;
39
39
40
- it ( 'should not sanitize data: URIs for images' , function ( ) {
41
- // image data uri
42
- // ref: http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
43
- testUrl = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" ;
44
- expect ( sanitizeImg ( testUrl ) ) . toBe ( 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' ) ;
45
- } ) ;
46
-
47
40
it ( 'should sanitize mailto: urls' , function ( ) {
48
41
testUrl = "mailto:[email protected] " ;
49
42
expect ( sanitizeImg ( testUrl ) ) . toBe ( 'unsafe:mailto:[email protected] ' ) ;
@@ -113,6 +106,17 @@ describe('sanitizeUri', function() {
113
106
expect ( sanitizeImg ( testUrl ) ) . toBe ( 'file:///foo/bar.html' ) ;
114
107
} ) ;
115
108
109
+ it ( 'should not sanitize blob urls' , function ( ) {
110
+ testUrl = "blob:///foo/bar.html" ;
111
+ expect ( sanitizeImg ( testUrl ) ) . toBe ( 'blob:///foo/bar.html' ) ;
112
+ } ) ;
113
+
114
+ it ( 'should not sanitize data: URIs for images' , function ( ) {
115
+ // image data uri
116
+ // ref: http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
117
+ testUrl = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" ;
118
+ expect ( sanitizeImg ( testUrl ) ) . toBe ( 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' ) ;
119
+ } ) ;
116
120
117
121
it ( 'should allow reconfiguration of the src whitelist' , function ( ) {
118
122
var returnVal ;
@@ -227,4 +231,4 @@ describe('sanitizeUri', function() {
227
231
228
232
} ) ;
229
233
230
- } ) ;
234
+ } ) ;
0 commit comments