@@ -818,7 +818,6 @@ describe("node-fetch", () => {
818
818
const url = `${ base } gzip` ;
819
819
return fetch ( url ) . then ( ( res ) => {
820
820
expect ( res . headers . get ( "content-type" ) ) . to . equal ( "text/plain" ) ;
821
- expect ( res . headers . get ( "content-encoding" ) ) . to . be . null ;
822
821
return res . text ( ) . then ( ( result ) => {
823
822
expect ( result ) . to . be . a ( "string" ) ;
824
823
expect ( result ) . to . equal ( "hello world" ) ;
@@ -837,9 +836,10 @@ describe("node-fetch", () => {
837
836
} ) ;
838
837
} ) ;
839
838
840
- it ( "should decompress capitalised Content-Encoding" , ( ) => {
839
+ it ( "should make capitalised Content-Encoding lowercase " , ( ) => {
841
840
const url = `${ base } gzip-capital` ;
842
841
return fetch ( url ) . then ( ( res ) => {
842
+ expect ( res . headers . get ( "content-encoding" ) ) . to . equal ( "gzip" ) ;
843
843
return res . text ( ) . then ( ( result ) => {
844
844
expect ( result ) . to . be . a ( "string" ) ;
845
845
expect ( result ) . to . equal ( "hello world" ) ;
@@ -851,7 +851,6 @@ describe("node-fetch", () => {
851
851
const url = `${ base } deflate` ;
852
852
return fetch ( url ) . then ( ( res ) => {
853
853
expect ( res . headers . get ( "content-type" ) ) . to . equal ( "text/plain" ) ;
854
- expect ( res . headers . get ( "content-encoding" ) ) . to . be . null ;
855
854
return res . text ( ) . then ( ( result ) => {
856
855
expect ( result ) . to . be . a ( "string" ) ;
857
856
expect ( result ) . to . equal ( "hello world" ) ;
@@ -878,7 +877,6 @@ describe("node-fetch", () => {
878
877
const url = `${ base } brotli` ;
879
878
return fetch ( url ) . then ( ( res ) => {
880
879
expect ( res . headers . get ( "content-type" ) ) . to . equal ( "text/plain" ) ;
881
- expect ( res . headers . get ( "content-encoding" ) ) . to . be . null ;
882
880
return res . text ( ) . then ( ( result ) => {
883
881
expect ( result ) . to . be . a ( "string" ) ;
884
882
expect ( result ) . to . equal ( "hello world" ) ;
@@ -908,7 +906,6 @@ describe("node-fetch", () => {
908
906
const url = `${ base } sdch` ;
909
907
return fetch ( url ) . then ( ( res ) => {
910
908
expect ( res . headers . get ( "content-type" ) ) . to . equal ( "text/plain" ) ;
911
- expect ( res . headers . get ( "content-encoding" ) ) . to . equal ( "sdch" ) ;
912
909
return res . text ( ) . then ( ( result ) => {
913
910
expect ( result ) . to . be . a ( "string" ) ;
914
911
expect ( result ) . to . equal ( "fake sdch string" ) ;
@@ -960,7 +957,6 @@ describe("node-fetch", () => {
960
957
} ;
961
958
return fetch ( url , options ) . then ( ( res ) => {
962
959
expect ( res . headers . get ( "content-type" ) ) . to . equal ( "text/plain" ) ;
963
- expect ( res . headers . get ( "content-encoding" ) ) . to . equal ( "gzip" ) ;
964
960
return res . text ( ) . then ( ( result ) => {
965
961
expect ( result ) . to . be . a ( "string" ) ;
966
962
expect ( result ) . to . not . equal ( "hello world" ) ;
0 commit comments