]> source.dussan.org Git - jquery.git/commitdiff
Fixes #6230. Added a unit test to control that, since the ajax rewrite, setting the...
authorjaubourg <j@ubourg.net>
Tue, 11 Jan 2011 22:01:18 +0000 (23:01 +0100)
committerjaubourg <j@ubourg.net>
Tue, 11 Jan 2011 22:01:18 +0000 (23:01 +0100)
test/unit/ajax.js

index 1b554021656e92a986ba18cbe493c86fac577499..c7803f857acb5bf6c40448683b4a1fcac0ec385a 100644 (file)
@@ -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 );