changeset 846:9b5e1c5f0240

Tests: added HTTP/2 test with charset.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 05 Feb 2016 17:40:56 +0300
parents e31f1b5bb569
children 7de036e89770
files h2.t
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h2.t
+++ b/h2.t
@@ -32,7 +32,7 @@ plan(skip_all => 'IO::Socket::SSL too ol
 
 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/)
 	->has(qw/limit_conn rewrite realip shmem/)
-	->has_daemon('openssl')->plan(306);
+	->has_daemon('openssl')->plan(307);
 
 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL
 
@@ -190,6 +190,10 @@ http {
             add_header X-Cookie-c $cookie_c;
             return 200;
         }
+        location /charset {
+            charset utf-8;
+            return 200;
+        }
     }
 
     server {
@@ -1351,6 +1355,15 @@ is($frame->{headers}->{'content-encoding
 ($frame) = grep { $_->{type} eq "DATA" } @$frames;
 gunzip_like($frame->{data}, qr/^SEE-THIS\Z/, 'gzip - DATA');
 
+# charset
+
+$sess = new_session();
+$sid = new_stream($sess, { path => '/charset' });
+$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
+
+($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
+is($frame->{headers}->{'content-type'}, 'text/plain; charset=utf-8', 'charset');
+
 # simple proxy cache test
 
 $sess = new_session();