diff options
author | jaubourg <j@ubourg.net> | 2011-01-11 23:01:18 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-01-11 23:01:18 +0100 |
commit | 6504d4f7005c99ea4064068f3d712322a064b97a (patch) | |
tree | 7ec4edd632bcd766e2045ae6e8819e2e8aedce47 | |
parent | 5a721cf31b142365954a2d71e860534da4536b16 (diff) | |
download | jquery-6504d4f7005c99ea4064068f3d712322a064b97a.tar.gz jquery-6504d4f7005c99ea4064068f3d712322a064b97a.zip |
Fixes #6230. Added a unit test to control that, since the ajax rewrite, setting the Accept header actually replaced the previous value and didn't append to it (tested in Safari 4.0.4 for which the problem was specifically reported).
-rw-r--r-- | test/unit/ajax.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 1b5540216..c7803f857 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -316,6 +316,28 @@ test(".ajax() - headers" , function() { }); +test(".ajax() - Accept header" , function() { + + expect( 1 ); + + stop(); + + jQuery.ajax(url("data/headers.php?keys=accept"), { + headers: { + Accept: "very wrong accept value" + }, + beforeSend: function( xhr ) { + xhr.setRequestHeader( "Accept", "*/*" ); + }, + success: function( data ) { + strictEqual( data , "accept: */*\n" , "Test Accept header is set to last value provided" ); + start(); + }, + error: function(){ ok(false, "error"); } + }); + +}); + test(".ajax() - contentType" , function() { expect( 2 ); |