File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,16 @@ class ExpressHTTPServer {
3838 app . use ( require ( 'compression' ) ( ) ) ;
3939 }
4040
41+ if ( this . cache && this . gzip ) {
42+ app . use ( function ( req , res , next ) {
43+ if ( res . body ) {
44+ res . send ( res . body ) ;
45+ } else {
46+ next ( ) ;
47+ }
48+ } ) ;
49+ }
50+
4151 if ( username !== undefined || password !== undefined ) {
4252 this . ui . writeLine ( `adding basic auth; username=${ username } ; password=${ password } ` ) ;
4353 app . use ( basicAuth ( username , password ) ) ;
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ class Worker {
3737 }
3838
3939 if ( ! this . httpServer . cache ) { this . httpServer . cache = this . cache ; }
40+ if ( ! this . httpServer . gzip ) { this . httpServer . gzip = this . gzip ; }
4041 if ( ! this . httpServer . distPath ) { this . httpServer . distPath = this . distPath ; }
4142 if ( ! this . httpServer . ui ) { this . httpServer . ui = this . ui ; }
4243 }
You can’t perform that action at this time.
0 commit comments