This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 8a5bf93  Allow for variations in content length
8a5bf93 is described below

commit 8a5bf934ea2a37a37a541db20b97aff53c4919c6
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Mar 15 20:54:26 2021 +0000

    Allow for variations in content length
---
 test/org/apache/coyote/http2/TestFlowControl.java | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestFlowControl.java 
b/test/org/apache/coyote/http2/TestFlowControl.java
index f49c13c..950a790 100644
--- a/test/org/apache/coyote/http2/TestFlowControl.java
+++ b/test/org/apache/coyote/http2/TestFlowControl.java
@@ -79,18 +79,26 @@ public class TestFlowControl extends Http2TestBase {
         parser.readFrame(true);
         // body
         parser.readFrame(true);
-        // reset (becasue the request body was not fully read)
+        // reset (because the request body was not fully read)
         parser.readFrame(true);
+
         // Validate response
+        // Response size varies as error page is generated and includes version
+        // number
+        String trace = output.getTrace();
+        int start = trace.indexOf("[content-length]-[") + 18;
+        int end = trace.indexOf("]", start);
+        String contentLength = trace.substring(start, end);
+
         Assert.assertEquals(
                 "3-HeadersStart\n" +
                 "3-Header-[:status]-[404]\n" +
                 "3-Header-[content-type]-[text/html;charset=utf-8]\n" +
                 "3-Header-[content-language]-[en]\n" +
-                "3-Header-[content-length]-[691]\n" +
+                "3-Header-[content-length]-[" + contentLength + "]\n" +
                 "3-Header-[date]-[Wed, 11 Nov 2015 19:18:42 GMT]\n" +
                 "3-HeadersEnd\n" +
-                "3-Body-691\n" +
+                "3-Body-" + contentLength + "\n" +
                 "3-EndOfStream\n" +
                 "3-RST-[8]\n", output.getTrace());
         output.clearTrace();


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to