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 {
38
38
app . use ( require ( 'compression' ) ( ) ) ;
39
39
}
40
40
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
+
41
51
if ( username !== undefined || password !== undefined ) {
42
52
this . ui . writeLine ( `adding basic auth; username=${ username } ; password=${ password } ` ) ;
43
53
app . use ( basicAuth ( username , password ) ) ;
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ class Worker {
37
37
}
38
38
39
39
if ( ! this . httpServer . cache ) { this . httpServer . cache = this . cache ; }
40
+ if ( ! this . httpServer . gzip ) { this . httpServer . gzip = this . gzip ; }
40
41
if ( ! this . httpServer . distPath ) { this . httpServer . distPath = this . distPath ; }
41
42
if ( ! this . httpServer . ui ) { this . httpServer . ui = this . ui ; }
42
43
}
You can’t perform that action at this time.
0 commit comments