diff --git a/Makefile b/Makefile index 301085b..362acd6 100644 --- a/Makefile +++ b/Makefile @@ -21,11 +21,17 @@ pull: serve: build docker run -it --rm -p 8080:80 -v "$$PWD"/build:/usr/local/apache2/htdocs/ httpd:2.4-alpine sh -c \ - "echo 'LoadModule rewrite_module modules/mod_rewrite.so' >> conf/httpd.conf;sed -i 's/AllowOverride None/AllowOverride All/' conf/httpd.conf;httpd -DFOREGROUND" + "echo 'LoadModule rewrite_module modules/mod_rewrite.so' >> conf/httpd.conf && \ + echo 'LoadModule deflate_module modules/mod_deflate.so' >> conf/httpd.conf && \ + echo 'LoadModule brotli_module modules/mod_brotli.so' >> conf/httpd.conf && \ + echo 'AddOutputFilterByType BROTLI_COMPRESS;DEFLATE text/html' >> conf/httpd.conf;sed -i 's/AllowOverride None/AllowOverride All/' conf/httpd.conf;httpd -DFOREGROUND" served: build docker run -d --rm -p 8080:80 -v "$$PWD"/build:/usr/local/apache2/htdocs/ httpd:2.4-alpine sh -c \ - "echo 'LoadModule rewrite_module modules/mod_rewrite.so' >> conf/httpd.conf;sed -i 's/AllowOverride None/AllowOverride All/' conf/httpd.conf;httpd -DFOREGROUND" + "echo 'LoadModule rewrite_module modules/mod_rewrite.so' >> conf/httpd.conf && \ + echo 'LoadModule deflate_module modules/mod_deflate.so' >> conf/httpd.conf && \ + echo 'LoadModule brotli_module modules/mod_brotli.so' >> conf/httpd.conf && \ + echo 'AddOutputFilterByType BROTLI_COMPRESS;DEFLATE text/html' >> conf/httpd.conf;sed -i 's/AllowOverride None/AllowOverride All/' conf/httpd.conf;httpd -DFOREGROUND" @sleep 2 @echo Container running. Use \"docker rm -f {containerId}\" to stop container. diff --git a/tests/integration.bash b/tests/integration.bash index b926f31..6d56cdb 100755 --- a/tests/integration.bash +++ b/tests/integration.bash @@ -21,9 +21,17 @@ skipif() { # check index endpoint -curl -v $base/ +curl -v $base/ --compressed match "HTTP/.* 200" match -iP "Content-Type: text/html[\r\n]" +match -iP "Content-Encoding: br[\r\n]" +match -iP "Vary: Accept-Encoding[\r\n]" + +curl -v $base/ --compressed -H 'Accept-Encoding: gzip, deflate' +match "HTTP/.* 200" +match -iP "Content-Type: text/html[\r\n]" +match -iP "Content-Encoding: gzip[\r\n]" +match -iP "Vary: Accept-Encoding[\r\n]" curl -v $base/invalid match "HTTP/.* 404"