Skip to content

Commit 00fb24f

Browse files
committed
Make sure POST requests have their contentType set correctly, and remove unneeded check for origSettings existence. Fixes #6811.
1 parent 0a1a860 commit 00fb24f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ajax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ jQuery.extend({
349349
// Need an extra try/catch for cross domain requests in Firefox 3
350350
try {
351351
// Set the correct header, if data is being sent
352-
if ( s.data || origSettings && origSettings.contentType ) {
352+
if ( s.data || type === "POST" || origSettings.contentType ) {
353353
xhr.setRequestHeader("Content-Type", s.contentType);
354354
}
355355

0 commit comments

Comments
 (0)