mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Revert "Ajax: Mitigate possible XSS vulnerability"
This reverts commit b078a62013
.
This commit is contained in:
parent
8dda094c7c
commit
ad358fd62b
@ -223,7 +223,7 @@ function ajaxConvert( s, response, jqXHR, isSuccess ) {
|
|||||||
|
|
||||||
if ( current ) {
|
if ( current ) {
|
||||||
|
|
||||||
// There's only work to do if current dataType is non-auto
|
// There's only work to do if current dataType is non-auto
|
||||||
if ( current === "*" ) {
|
if ( current === "*" ) {
|
||||||
|
|
||||||
current = prev;
|
current = prev;
|
||||||
|
@ -4,13 +4,6 @@ define( [
|
|||||||
"../ajax"
|
"../ajax"
|
||||||
], function( jQuery, document ) {
|
], function( jQuery, document ) {
|
||||||
|
|
||||||
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
|
|
||||||
jQuery.ajaxPrefilter( function( s ) {
|
|
||||||
if ( s.crossDomain ) {
|
|
||||||
s.contents.script = false;
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
// Install script dataType
|
// Install script dataType
|
||||||
jQuery.ajaxSetup( {
|
jQuery.ajaxSetup( {
|
||||||
accepts: {
|
accepts: {
|
||||||
|
@ -71,54 +71,6 @@ QUnit.module( "ajax", {
|
|||||||
};
|
};
|
||||||
} );
|
} );
|
||||||
|
|
||||||
ajaxTest( "jQuery.ajax() - do not execute js (crossOrigin)", 2, function( assert ) {
|
|
||||||
return {
|
|
||||||
create: function( options ) {
|
|
||||||
options.crossDomain = true;
|
|
||||||
return jQuery.ajax( url( "data/script.php?header=ecma" ), options );
|
|
||||||
},
|
|
||||||
success: function() {
|
|
||||||
assert.ok( true, "success" );
|
|
||||||
},
|
|
||||||
complete: function() {
|
|
||||||
assert.ok( true, "complete" );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} );
|
|
||||||
|
|
||||||
ajaxTest( "jQuery.ajax() - execute js for crossOrigin when dataType option is provided", 3,
|
|
||||||
function( assert ) {
|
|
||||||
return {
|
|
||||||
create: function( options ) {
|
|
||||||
options.crossDomain = true;
|
|
||||||
options.dataType = "script";
|
|
||||||
return jQuery.ajax( url( "data/script.php?header=ecma" ), options );
|
|
||||||
},
|
|
||||||
success: function() {
|
|
||||||
assert.ok( true, "success" );
|
|
||||||
},
|
|
||||||
complete: function() {
|
|
||||||
assert.ok( true, "complete" );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
ajaxTest( "jQuery.ajax() - do not execute js (crossOrigin)", 2, function( assert ) {
|
|
||||||
return {
|
|
||||||
create: function( options ) {
|
|
||||||
options.crossDomain = true;
|
|
||||||
return jQuery.ajax( url( "data/script.php" ), options );
|
|
||||||
},
|
|
||||||
success: function() {
|
|
||||||
assert.ok( true, "success" );
|
|
||||||
},
|
|
||||||
complete: function() {
|
|
||||||
assert.ok( true, "complete" );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} );
|
|
||||||
|
|
||||||
ajaxTest( "jQuery.ajax() - success callbacks (late binding)", 8, function( assert ) {
|
ajaxTest( "jQuery.ajax() - success callbacks (late binding)", 8, function( assert ) {
|
||||||
return {
|
return {
|
||||||
setup: addGlobalEvents( "ajaxStart ajaxStop ajaxSend ajaxComplete ajaxSuccess", assert ),
|
setup: addGlobalEvents( "ajaxStart ajaxStop ajaxSend ajaxComplete ajaxSuccess", assert ),
|
||||||
|
Loading…
Reference in New Issue
Block a user