mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
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).
This commit is contained in:
parent
5a721cf31b
commit
6504d4f700
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user