Skip to content

Commit cfe830e

Browse files
committed
Revert "Ajax: Mitigate possible XSS vulnerability"
This reverts commit f60729f. Fixes jquerygh-3011 Refs ad358fd
1 parent 22ce99a commit cfe830e

File tree

2 files changed

+0
-45
lines changed

2 files changed

+0
-45
lines changed

src/ajax/script.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ define( [
44
"../ajax"
55
], function( jQuery, document ) {
66

7-
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
8-
jQuery.ajaxPrefilter( function( s ) {
9-
if ( s.crossDomain ) {
10-
s.contents.script = false;
11-
}
12-
} );
13-
147
// Install script dataType
158
jQuery.ajaxSetup( {
169
accepts: {

test/unit/ajax.js

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -85,44 +85,6 @@ QUnit.module( "ajax", {
8585
};
8686
} );
8787

88-
ajaxTest( "jQuery.ajax() - execute js for crossOrigin when dataType option is provided", 3,
89-
function( assert ) {
90-
return {
91-
create: function( options ) {
92-
options.crossDomain = true;
93-
options.dataType = "script";
94-
return jQuery.ajax( url( "data/script.php?header=ecma" ), options );
95-
},
96-
success: function() {
97-
assert.ok( true, "success" );
98-
},
99-
complete: function() {
100-
assert.ok( true, "complete" );
101-
}
102-
};
103-
}
104-
);
105-
106-
ajaxTest( "jQuery.ajax() - do not execute js (crossOrigin)", 2, function( assert ) {
107-
return {
108-
create: function( options ) {
109-
options.crossDomain = true;
110-
return jQuery.ajax( url( "data/script.php" ), options );
111-
},
112-
success: function() {
113-
assert.ok( true, "success" );
114-
},
115-
fail: function() {
116-
if ( jQuery.support.cors === false ) {
117-
assert.ok( true, "fail" );
118-
}
119-
},
120-
complete: function() {
121-
assert.ok( true, "complete" );
122-
}
123-
};
124-
} );
125-
12688
ajaxTest( "jQuery.ajax() - success callbacks (late binding)", 8, function( assert ) {
12789
return {
12890
setup: addGlobalEvents( "ajaxStart ajaxStop ajaxSend ajaxComplete ajaxSuccess", assert ),

0 commit comments

Comments
 (0)