git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes #8219. Introduces the mimeType option to override content-type header in conver...
[jquery.git]
/
src
/
ajax.js
diff --git
a/src/ajax.js
b/src/ajax.js
index
15ad6a8
..
5a6ac26
100644
(file)
--- a/
src/ajax.js
+++ b/
src/ajax.js
@@
-426,6
+426,14
@@
jQuery.extend({
return match || null;
},
return match || null;
},
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( state === 0 ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
// Cancel the request
abort: function( statusText ) {
statusText = statusText || "abort";
// Cancel the request
abort: function( statusText ) {
statusText = statusText || "abort";
@@
-827,7
+835,7
@@
function ajaxHandleResponses( s, jqXHR, responses ) {
while( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
while( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
- ct = jqXHR.getResponseHeader( "content-type" );
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
}
}
}
}