changeset 1519:787d904bdfe0

Tests: fixed reading chunked body in HTTP/2 unbuffered body tests. Previously, tests didn't expect that a final chunk can be sent separately.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 10 Oct 2019 18:15:02 +0300
parents fca71a8ebf6d
children 9521130f6f22
files h2_proxy_request_buffering.t h2_proxy_request_buffering_ssl.t
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/h2_proxy_request_buffering.t
+++ b/h2_proxy_request_buffering.t
@@ -240,6 +240,8 @@ sub get_body {
 			$got += $chunked ? hex $_ : $_ for $chunked
 				? $body =~ /(\w+)\x0d\x0a?\w+\x0d\x0a?/g
 				: length($body);
+			next if $chunked && !$extra{body_more}
+				&& $buf !~ /^0\x0d\x0a?/m;
 			last if $got >= $len;
 		}
 
--- a/h2_proxy_request_buffering_ssl.t
+++ b/h2_proxy_request_buffering_ssl.t
@@ -245,6 +245,8 @@ sub get_body {
 			$got += $chunked ? hex $_ : $_ for $chunked
 				? $body =~ /(\w+)\x0d\x0a?\w+\x0d\x0a?/g
 				: length($body);
+			next if $chunked && !$extra{body_more}
+				&& $buf !~ /^0\x0d\x0a?/m;
 			last if $got >= $len;
 		}