@@ -677,26 +677,26 @@ describe("FakeXMLHttpRequest", function () {
677677 ) ;
678678 } ) ;
679679
680- it ( "does not override mime " , function ( ) {
680+ it ( "preserves caller-provided Content-Type " , function ( ) {
681681 this . xhr . open ( "POST" , "/" ) ;
682682 this . xhr . setRequestHeader ( "Content-Type" , "text/html" ) ;
683683 this . xhr . send ( "Data" ) ;
684684
685- assert . equals (
686- this . xhr . requestHeaders [ "Content-Type" ] ,
687- "text/html;charset=utf-8" ,
688- ) ;
685+ assert . equals ( this . xhr . requestHeaders [ "Content-Type" ] , "text/html" ) ;
689686 } ) ;
690687
691- it ( "does not add new 'Content-Type' header if ' content-type' already exists " , function ( ) {
688+ it ( "preserves caller-provided content-type casing and value " , function ( ) {
692689 this . xhr . open ( "POST" , "/" ) ;
693- this . xhr . setRequestHeader ( "content-type" , "application/json" ) ;
690+ this . xhr . setRequestHeader (
691+ "content-type" ,
692+ "application/json; charset=iso-8859-1" ,
693+ ) ;
694694 this . xhr . send ( "Data" ) ;
695695
696696 assert . isUndefined ( this . xhr . requestHeaders [ "Content-Type" ] ) ;
697697 assert . equals (
698698 this . xhr . requestHeaders [ "content-type" ] ,
699- "application/json;charset=utf-8 " ,
699+ "application/json; charset=iso-8859-1 " ,
700700 ) ;
701701 } ) ;
702702
0 commit comments