@@ -658,9 +658,9 @@ describe('compression()', function () {
658
658
} )
659
659
} )
660
660
661
- describe ( 'defaultEncoding ' , function ( ) {
661
+ describe ( 'enforceEncoding ' , function ( ) {
662
662
it ( 'should compress the provided encoding and not the default encoding' , function ( done ) {
663
- var server = createServer ( { threshold : 0 , defaultEncoding : 'deflate' } , function ( req , res ) {
663
+ var server = createServer ( { threshold : 0 , enforceEncoding : 'deflate' } , function ( req , res ) {
664
664
res . setHeader ( 'Content-Type' , 'text/plain' )
665
665
res . end ( 'hello, world' )
666
666
} )
@@ -672,8 +672,8 @@ describe('compression()', function () {
672
672
. expect ( 200 , 'hello, world' , done )
673
673
} )
674
674
675
- it ( 'should not compress when defaultEncoding is identity' , function ( done ) {
676
- var server = createServer ( { threshold : 0 , defaultEncoding : 'identity' } , function ( req , res ) {
675
+ it ( 'should not compress when enforceEncoding is identity' , function ( done ) {
676
+ var server = createServer ( { threshold : 0 , enforceEncoding : 'identity' } , function ( req , res ) {
677
677
res . setHeader ( 'Content-Type' , 'text/plain' )
678
678
res . end ( 'hello, world' )
679
679
} )
@@ -685,8 +685,8 @@ describe('compression()', function () {
685
685
. expect ( 200 , 'hello, world' , done )
686
686
} )
687
687
688
- it ( 'should compress when defaultEncoding is gzip' , function ( done ) {
689
- var server = createServer ( { threshold : 0 , defaultEncoding : 'gzip' } , function ( req , res ) {
688
+ it ( 'should compress when enforceEncoding is gzip' , function ( done ) {
689
+ var server = createServer ( { threshold : 0 , enforceEncoding : 'gzip' } , function ( req , res ) {
690
690
res . setHeader ( 'Content-Type' , 'text/plain' )
691
691
res . end ( 'hello, world' )
692
692
} )
@@ -698,8 +698,8 @@ describe('compression()', function () {
698
698
. expect ( 200 , 'hello, world' , done )
699
699
} )
700
700
701
- it ( 'should compress when defaultEncoding is deflate' , function ( done ) {
702
- var server = createServer ( { threshold : 0 , defaultEncoding : 'deflate' } , function ( req , res ) {
701
+ it ( 'should compress when enforceEncoding is deflate' , function ( done ) {
702
+ var server = createServer ( { threshold : 0 , enforceEncoding : 'deflate' } , function ( req , res ) {
703
703
res . setHeader ( 'Content-Type' , 'text/plain' )
704
704
res . end ( 'hello, world' )
705
705
} )
@@ -711,8 +711,8 @@ describe('compression()', function () {
711
711
. expect ( 200 , 'hello, world' , done )
712
712
} )
713
713
714
- it ( 'should not compress when defaultEncoding is unknown' , function ( done ) {
715
- var server = createServer ( { threshold : 0 , defaultEncoding : 'bogus' } , function ( req , res ) {
714
+ it ( 'should not compress when enforceEncoding is unknown' , function ( done ) {
715
+ var server = createServer ( { threshold : 0 , enforceEncoding : 'bogus' } , function ( req , res ) {
716
716
res . setHeader ( 'Content-Type' , 'text/plain' )
717
717
res . end ( 'hello, world' )
718
718
} )
@@ -724,8 +724,8 @@ describe('compression()', function () {
724
724
. expect ( 200 , 'hello, world' , done )
725
725
} )
726
726
727
- it ( 'should be gzip if no accept-encoding is sent when defaultEncoding is *' , function ( done ) {
728
- var server = createServer ( { threshold : 0 , defaultEncoding : '*' } , function ( req , res ) {
727
+ it ( 'should be gzip if no accept-encoding is sent when enforceEncoding is *' , function ( done ) {
728
+ var server = createServer ( { threshold : 0 , enforceEncoding : '*' } , function ( req , res ) {
729
729
res . setHeader ( 'Content-Type' , 'text/plain' )
730
730
res . end ( 'hello, world' )
731
731
} )
0 commit comments