Removed non-standard (and not that useful) xhr emulation methods & reworked the headers test as a consequence.
This commit is contained in:
parent
317888464d
commit
9b9d270e3d
3 changed files with 55 additions and 37 deletions
19
src/xhr.js
19
src/xhr.js
|
@ -147,8 +147,8 @@ jQuery.xhr = function( _native ) {
|
|||
accepts[ "*" ];
|
||||
|
||||
// Check for headers option
|
||||
if ( headers ) {
|
||||
xhr.setRequestHeaders( headers );
|
||||
for ( i in headers ) {
|
||||
requestHeaders[ i.toLowerCase() ] = headers[ i ];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -554,21 +554,6 @@ jQuery.xhr = function( _native ) {
|
|||
return xhr;
|
||||
},
|
||||
|
||||
// Ditto with an s
|
||||
setRequestHeaders: function(map) {
|
||||
checkState(1, !sendFlag);
|
||||
for ( var name in map ) {
|
||||
requestHeaders[ name.toLowerCase() ] = map[name];
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
|
||||
// Utility method to get headers set
|
||||
getRequestHeader: function(name) {
|
||||
checkState(1, !sendFlag);
|
||||
return requestHeaders[ name.toLowerCase() ];
|
||||
},
|
||||
|
||||
// Raw string
|
||||
getAllResponseHeaders: function() {
|
||||
return xhr.readyState <= 1 ? "" : responseHeadersString;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue