Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
27 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
file_put_contents("csp.log", "", LOCK_EX); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
file_put_contents("csp.log", "error", LOCK_EX); | ||
?> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -30,6 +30,24 @@ if ( jQuery.css ) { | ||
}); | ||
} | ||
|
||
|
||
// This test checkes CSP only for browsers with "Content-Security-Policy" header support | ||
// i.e. no old WebKit or old Firefox | ||
testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Security/CSP) restrictions", | ||
"support/csp.php", | ||
function( support ) { | ||
expect( 2 ); | ||
deepEqual( jQuery.extend( {}, support ), computedSupport, "No violations of CSP polices" ); | ||
|
||
stop(); | ||
|
||
supportjQuery.get( "data/support/csp.log" ).done(function( data ) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
markelog
Author
Member
|
||
equal( data, "", "No log request should be sent" ); | ||
supportjQuery.get( "data/support/csp-clean.php" ).done( start ); | ||
}); | ||
} | ||
); | ||
|
||
(function() { | ||
var expected, version, | ||
userAgent = window.navigator.userAgent; | ||
@@ -175,17 +193,3 @@ if ( jQuery.css ) { | ||
} | ||
|
||
})(); | ||
|
||
// 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 ), computedSupport, "No violations of CSP polices" ); | ||
} | ||
); | ||
} |
IE<11 seems not to process this
done
callback. We might want to try making it analways
and/or updatesupportjQuery
from 1.9.1.