You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2017/02/16 21:37:09 UTC
svn commit: r1783308 - /httpd/test/framework/trunk/t/modules/brotli.t
Author: wrowe
Date: Thu Feb 16 21:37:09 2017
New Revision: 1783308
URL: http://svn.apache.org/viewvc?rev=1783308&view=rev
Log:
Test prioritaztion of brotls+deflate
Modified:
httpd/test/framework/trunk/t/modules/brotli.t
Modified: httpd/test/framework/trunk/t/modules/brotli.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/brotli.t?rev=1783308&r1=1783307&r2=1783308&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/brotli.t (original)
+++ httpd/test/framework/trunk/t/modules/brotli.t Thu Feb 16 21:37:09 2017
@@ -5,7 +5,7 @@ use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest;
-plan tests => 8, need_module 'brotli', need_module 'alias';
+plan tests => 10, need_module 'brotli', need_module 'alias';
my $r;
@@ -51,7 +51,7 @@ if (!defined($r->header("ETag"))) {
if (have_module('deflate')) {
# GET request against the location with fallback to deflate (test that
# Brotli is chosen due to the order in SetOutputFilter).
- $r = GET("/brotli_and_deflate/apache_pb.gif", "Accept-Encoding" => "deflate, br");
+ $r = GET("/brotli_and_deflate/apache_pb.gif", "Accept-Encoding" => "gzip,br");
ok t_cmp($r->code, 200);
ok t_cmp($r->header("Content-Encoding"), "br", "response Content-Encoding is OK");
if (!defined($r->header("Content-Length"))) {
@@ -62,6 +62,17 @@ if (have_module('deflate')) {
t_debug "ETag field was expected";
ok 0;
}
+ $r = GET("/brotli_and_deflate/apache_pb.gif", "Accept-Encoding" => "gzip");
+ ok t_cmp($r->code, 200);
+ ok t_cmp($r->header("Content-Encoding"), "gzip", "response Content-Encoding is OK");
+ if (!defined($r->header("Content-Length"))) {
+ t_debug "Content-Length was expected";
+ ok 0;
+ }
+ if (!defined($r->header("ETag"))) {
+ t_debug "ETag field was expected";
+ ok 0;
+ }
} else {
- skip "skipping tests without mod_deflate" foreach (1..2);
+ skip "skipping tests without mod_deflate" foreach (1..4);
}