git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d684122
)
Allow the user to explicitly set a content-type header even when there's no data...
author
John Resig
<jeresig@gmail.com>
Sat, 5 Dec 2009 02:20:58 +0000
(21:20 -0500)
committer
John Resig
<jeresig@gmail.com>
Sat, 5 Dec 2009 02:20:58 +0000
(21:20 -0500)
src/ajax.js
patch
|
blob
|
history
diff --git
a/src/ajax.js
b/src/ajax.js
index
59c231c
..
9442608
100644
(file)
--- a/
src/ajax.js
+++ b/
src/ajax.js
@@
-195,10
+195,8
@@
jQuery.extend({
lastModified: {},
etag: {},
lastModified: {},
etag: {},
- ajax: function( s ) {
- // Extend the settings, but re-extend 's' so that it can be
- // checked again later (in the test suite, specifically)
- s = jQuery.extend(true, {}, jQuery.ajaxSettings, s);
+ ajax: function( origSettings ) {
+ var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
var jsonp, status, data,
callbackContext = s.context || window,
var jsonp, status, data,
callbackContext = s.context || window,
@@
-333,7
+331,7
@@
jQuery.extend({
// Need an extra try/catch for cross domain requests in Firefox 3
try {
// Set the correct header, if data is being sent
// Need an extra try/catch for cross domain requests in Firefox 3
try {
// Set the correct header, if data is being sent
- if ( s.data ) {
+ if ( s.data || origSettings.contentType ) {
xhr.setRequestHeader("Content-Type", s.contentType);
}
xhr.setRequestHeader("Content-Type", s.contentType);
}