tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [tomcat] branch 8.5.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63403
Date Mon, 13 May 2019 19:31:25 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new c7095ae  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63403
c7095ae is described below

commit c7095aeb50c10c972fdd22b98000401fc1ffff99
Author: Konstantin Kolinko <kkolinko@apache.org>
AuthorDate: Sun May 5 17:13:48 2019 +0300

    Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63403
    
    Fix TestHttp2InitialConnection test failures on a non-English PC.
    
    1. The language was hard-coded as "en".
    2. The length check was off, as String.getBytes() uses OS default code page, but the actual
response is in UTF-8.
---
 test/org/apache/coyote/http2/TestHttp2InitialConnection.java | 10 ++++++----
 webapps/docs/changelog.xml                                   |  8 +++++++-
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestHttp2InitialConnection.java b/test/org/apache/coyote/http2/TestHttp2InitialConnection.java
index 61a9fbd..c1c0702 100644
--- a/test/org/apache/coyote/http2/TestHttp2InitialConnection.java
+++ b/test/org/apache/coyote/http2/TestHttp2InitialConnection.java
@@ -118,12 +118,14 @@ public class TestHttp2InitialConnection extends Http2TestBase {
              */
             int serverInfoLength = ServerInfo.getServerInfo().getBytes().length;
             StringManager sm = StringManager.getManager(ErrorReportValve.class);
-            int statusHeaderLength = sm.getString(
-                    "errorReportValve.statusHeader", "", "").getBytes().length;
+            int statusHeaderLength = sm
+                    .getString("errorReportValve.statusHeader", "", "")
+                    .getBytes(StandardCharsets.UTF_8).length;
             int len = 1073 + serverInfoLength + statusHeaderLength * 2;
             String contentLength = String.valueOf(len);
-            return getResponseBodyFrameTrace(streamId, testData.getExpectedStatus(),
-                    "text/html;charset=utf-8", "en", contentLength, contentLength);
+            return getResponseBodyFrameTrace(streamId,
+                    testData.getExpectedStatus(), "text/html;charset=utf-8",
+                    sm.getLocale().getLanguage(), contentLength, contentLength);
         } else {
             Assert.fail();
             // To keep the IDE happy
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6d28e08..51daa4b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -74,7 +74,13 @@
   </subsection>
   <subsection name="Other">
     <changelog>
-      <update>Switch from FindBugs to SpotBugs. (fschumacher)</update>
+      <update>
+        Switch from FindBugs to SpotBugs. (fschumacher)
+      </update>
+      <fix>
+        <bug>63403</bug>: Fix TestHttp2InitialConnection test failures when
+        running with a non-English locale. (kkolinko)
+      </fix>
     </changelog>
   </subsection>
 </section>


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


Mime
View raw message