diff options
author | jaubourg <j@ubourg.net> | 2011-02-05 03:08:35 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-02-05 03:08:35 +0100 |
commit | d6fbbe1080fdcaf8eb22753eddf000aeb7d99545 (patch) | |
tree | dc27ae14bdb576b6dc5de225caaf074916b54fde /src/ajax | |
parent | 2c77704b145a24ad39648740466ed015fd4163dc (diff) | |
download | jquery-d6fbbe1080fdcaf8eb22753eddf000aeb7d99545.tar.gz jquery-d6fbbe1080fdcaf8eb22753eddf000aeb7d99545.zip |
Fixes #8177. XHR transport now considers 304 Not Modified responses as 200 OK if no conditional request header was provided (as per the XMLHttpRequest specification).
Diffstat (limited to 'src/ajax')
-rw-r--r-- | src/ajax/xhr.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 91a71de8d..b18274c43 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -178,6 +178,12 @@ if ( jQuery.support.ajax ) { // IE - #1450: sometimes returns 1223 when it should be 204 if ( status === 1223 ) { status = 204; + // Various - #8177: a Not Modified response was received + // yet no conditional request headers was provided + } else if ( status === 304 && + !headers[ "if-modified-since" ] && + !headers[ "if-none-match" ] ) { + status = 200; // Status 0 encompasses several cases } else if ( !status ) { // Cross-domain |