Ajax: improve content-type detection

Fixes gh-2584
Closes gh-2643
This commit is contained in:
Oleg Gaidarenko
2015-10-12 19:56:46 +03:00
parent cb087ce41d
commit 239169bb2e
4 changed files with 112 additions and 5 deletions

View File

@@ -322,9 +322,9 @@ jQuery.extend( {
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
xml: /\bxml\b/,
html: /\bhtml/,
json: /\bjson\b/
},
responseFields: {

View File

@@ -18,7 +18,7 @@ jQuery.ajaxSetup( {
"application/ecmascript, application/x-ecmascript"
},
contents: {
script: /(?:java|ecma)script/
script: /\b(?:java|ecma)script\b/
},
converters: {
"text script": function( text ) {