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:
bd6eb84
)
Removes unnecessary test and ensures getResponseHeader returns null if the header...
author
jaubourg
<j@ubourg.net>
Wed, 19 Jan 2011 16:21:51 +0000
(17:21 +0100)
committer
jaubourg
<j@ubourg.net>
Wed, 19 Jan 2011 16:21:51 +0000
(17:21 +0100)
src/ajax.js
patch
|
blob
|
history
diff --git
a/src/ajax.js
b/src/ajax.js
index
b903358
..
3d1f9a3
100644
(file)
--- a/
src/ajax.js
+++ b/
src/ajax.js
@@
-295,30
+295,25
@@
jQuery.extend({
},
// Builds headers hashtable if needed
},
// Builds headers hashtable if needed
- // (match is used internally)
- getResponseHeader: function( key , match ) {
+ getResponseHeader: function( key ) {
+
+ var match;
if ( state === 2 ) {
if ( state === 2 ) {
- if ( responseHeaders === undefined ) {
+ if ( !responseHeaders ) {
responseHeaders = {};
responseHeaders = {};
- if ( typeof responseHeadersString === "string" ) {
-
- while( ( match = rheaders.exec( responseHeadersString ) ) ) {
- responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
- }
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
}
}
match = responseHeaders[ key.toLowerCase() ];
}
}
match = responseHeaders[ key.toLowerCase() ];
- } else {
-
- match = null;
}
}
- return match;
+ return match || null;
},
// Cancel the request
},
// Cancel the request