]> source.dussan.org Git - jquery.git/commitdiff
Fix 363299ac failures: protect Safari 5.1 from CSP
authorRichard Gibson <richard.gibson@gmail.com>
Fri, 8 Feb 2013 04:43:21 +0000 (23:43 -0500)
committerRichard Gibson <richard.gibson@gmail.com>
Fri, 8 Feb 2013 04:43:21 +0000 (23:43 -0500)
test/unit/support.js

index 93f7a76d74f39d98a8be9b3a197c02ab7950f19b..83a50f4462fe713863e24c7ae1e8a59540c4c8a7 100644 (file)
@@ -29,7 +29,13 @@ testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlo
        strictEqual( shrinkWrapBlocks, jQuery.support.shrinkWrapBlocks, "jQuery.support.shrinkWrapBlocks properties are the same" );
 });
 
-testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Security/CSP) restrictions", "support/csp.php", function( support ) {
-       expect( 1 );
-       deepEqual( jQuery.extend( {}, support ), jQuery.support, "No violations of CSP polices" );
-});
+// Support: Safari 5.1
+// Shameless browser-sniff, but Safari 5.1 mishandles CSP
+if ( !( typeof navigator !== "undefined" &&
+       (/ AppleWebKit\/\d.*? Version\/(\d+)/.exec(navigator.userAgent) || [])[1] < 6 ) ) {
+
+       testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Security/CSP) restrictions", "support/csp.php", function( support ) {
+               expect( 1 );
+               deepEqual( jQuery.extend( {}, support ), jQuery.support, "No violations of CSP polices" );
+       });
+}