File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ const sleep = promisify(setTimeout);
1212app . set ( 'json spaces' , 2 ) ;
1313app . set ( 'trust proxy' , [ 'loopback' , 'linklocal' , 'uniquelocal' ] ) ;
1414
15- app . use ( morgan ( 'combined' ) ) ;
15+ if ( process . env . DISABLE_REQUEST_LOGS !== 'true' ) {
16+ app . use ( morgan ( 'combined' ) ) ;
17+ }
1618
1719app . use ( function ( req , res , next ) {
1820 req . pipe ( concat ( function ( data ) {
Original file line number Diff line number Diff line change @@ -213,6 +213,23 @@ else
213213fi
214214
215215
216+ message " Stop containers "
217+ docker stop http-echo-tests
218+
219+ message " Start container with DISABLE_REQUEST_LOGS "
220+ docker run -d --rm -e DISABLE_REQUEST_LOGS=true --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
221+ sleep 5
222+ curl -s -k -X GET https://localhost:8443/strawberry > /dev/null
223+ if [ $( docker logs http-echo-tests | grep -c " GET /strawberry HTTP/1.1" ) -eq 0 ]
224+ then
225+ passed " DISABLE_REQUEST_LOGS disabled Express HTTP logging"
226+ else
227+ failed " DISABLE_REQUEST_LOGS failed"
228+ docker logs http-echo-tests
229+ exit 1
230+ fi
231+
232+
216233message " Stop containers "
217234docker stop http-echo-tests
218235
You can’t perform that action at this time.
0 commit comments